小游戏开发工具中 worker 使用 setTimeout 出错

发布于 7 年前作者 slin19050 次浏览最后编辑 7 年前来自 ask

在实机测试没有问题,只在开发者工具中报错,经测macOS端开发者工具也是一样情况。


worker中的代码 :

var test = function(){

console.log(“timeout tick”);

}

setTimeout(test,1000);

开发者工具console信息

VM32:3 Uncaught ReferenceError: Reporter is not defined

    at setTimeout (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:3:10423)

    at eval (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:8:1)

    at require (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:3:24484)

    at o (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:3:23372)

    at eval (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:3:13744)

    at eval (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:1:3789)

    at Array.forEach (<anonymous>)

    at Object.h (eval at self.onmessage.event (weixinworker.js:6), <anonymous>:1:3747)

    at self.onmessage.event (weixinworker.js:10)

3 回复
caowei
caowei1 楼6 年前

太感谢了,期待更新。

zmo
zmo2 楼6 年前

我这里还是报这个做,代码类似,这个Reporter是指什么呢?

yqiu
yqiu3 楼5 年前

多谢反馈,并不是 setTimeout 在工具中不可用,而是我们内部逻辑的报错,目前已定位到问题,我们下个版本修复一下