You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Wagmi提交区块链交易时Windows浏览器无详细错误信息排查

Windows浏览器中Wagmi交易错误信息缺失问题

使用Wagmi向区块链提交一笔大概率已回滚的交易时,Windows电脑上的任意浏览器仅能显示Error类的基础信息,日志如下:

Uncaught (in promise) ContractFunctionExecutionError
    at getContractError (getContractError.js:34:12)
    at simulateContract (simulateContract.js:83:98)
    at async simulateContract (simulateContract.js:30:33)
    at async writeContract (writeContract.js:29:46)Caused by: ContractFunctionZeroDataError
    at eval (getContractError.js:22:20)
    at getContractError (getContractError.js:33:7)
    at simulateContract (simulateContract.js:83:98)
    at async simulateContract (simulateContract.js:30:33)
    at async writeContract (writeContract.js:29:46)

但运行完全相同的代码(托管在同一Windows电脑),在Mac端的同一款浏览器中却能显示完整的错误详情:

Uncaught (in promise) ContractFunctionExecutionError: The contract function "approve" returned no data ("0x").
This could be due to any of the following:
  - The contract does not have the function "approve",
  - The parameters passed to the contract function may be invalid, or
  - The address is not a contract.
Contract Call:
  address:   0x**** (some ERC20 contract address)
  function:  approve(address spender, uint256 amount)
  args:             (0x******* , 41700000000000000)
  sender:    0x**** (my wallet address)
Version: viem@2.7.6
    at getContractError (getContractError.js:34:12)
    at simulateContract (simulateContract.js:83:98)
    at async simulateContract (simulateContract.js:30:33)
    at async writeContract (writeContract.js:29:46)
    ... (the rest of the stack trace)

两个错误均触发于同一行getContractError.js:34。

请问这是什么原因?是否是Windows端Chrome和Edge浏览器的配置导致错误信息被隐藏?如何在Windows端获取包含问题原因的完整错误信息?提交错误交易后本该得到有意义的错误说明,但目前几乎获取不到有效内容。

内容的提问来源于stack exchange,提问作者King Witcher

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 03:06:08