clojurescript - 发布版本上的“未捕获的 TypeError:d.methods.nl 不是函数”
问题描述
我从 ClojureScript 调用以太坊上的交易。在开发版本上它工作正常,但在发布版本上我总是收到这种错误:
Uncaught TypeError: d.methods.nl is not a function
或
Uncaught TypeError: b.methods.pl is not a function
等等。
我发现只有一个事务调用有效,我只看到与其他事务调用的一个区别:没有参数。
这是产生错误消息的代码示例(在 send 方法中):
(defn end-staking [vampire-address graph-stake-id rewards-token-decimals]
(let [vampire (h/get-vampire-instance vampire-address)
account @(rf/subscribe [::web3-subs/web3-account])
stake-id (subs graph-stake-id 43)
step (get-in @values [graph-stake-id :step])]
(-> (.send
(.endStaking (.-methods vampire)
stake-id)
#js {:from account
:gasLimit "5000000"})
(.then (fn [receipt]
(js/console.log "receipt end-staking" receipt)))
(.catch (fn [error]
(h/hadle-transaction-error error))))))
这是有效的代码:
(defn close [vampire-address coffin-address]
(let [coffin (h/get-coffin-instance coffin-address)
account @(rf/subscribe [::web3-subs/web3-account])]
(-> (.send
(.close (.-methods coffin))
#js {:from account})
(.then (fn [receipt]
(js/console.log "receipt close" receipt)))
(.catch (fn [error]
(h/hadle-transaction-error error))))))
解决方案
推荐阅读
- java - 如何使用回溯搜索解决问题?
- android - 如何修复 Kotlin 中 FileInputStream 和 FileDescriptor 的错误路径
- python - 使用 scikit learn 创建混淆矩阵时出错
- flutter - 如何在聊天应用程序的标题栏底部固定日期
- php - SSE 或 Websockets 或 AJAX - 服务器负载
- android - 如何解决使用后退按钮相互调用的 2 个活动的 InstanceCountViolation?
- javascript - 我的 react-hook-form 正在向 axios 请求发送一个空数组?
- node.js - 无法将 nginx 代理传递到不同端点上的不同端口
- bash - Bash 脚本在运行时抛出“缺少操作数”的错误
- javascript - 如何通过网站在打印对话中使用网站字体?