微信小程序 “WAService.js:2 SyntaxError: Unexpected token var” “[渲染层错误] ReferenceError: $gwx is not define

用antmove把支付宝小程序转化成了微信小程序(我把支付宝的mini-ali-ui也用antmove转了),用微信开发者工具打开后编译报错

这个报错并没有精确到具体文件,只能一个个文件移除掉去排查是哪个文件导致的

最后发现是

mini-ali-ui\es\tabs\util.wxs里的

for (var i = 0, n1, n2; i < version.length; i++) 

造成的,改成

  var n1, n2;

  for (var i = 0; i < version.length; i++) 

即可

 

 

报错内容:

VM1042 WAService.js:2 SyntaxError: Unexpected token var
errorReport @ VM1042 WAService.js:2
thirdErrorReport @ VM1042 WAService.js:2
(anonymous) @ VM1042 WAService.js:2
I @ VM1042 WAService.js:2
n @ VM1042 WAService.js:2
(anonymous) @ VM1042 WAService.js:2
value @ VM1042 WAService.js:2
(anonymous) @ VM1042 WAService.js:2
error (async)
(anonymous) @ VM1042 WAService.js:2
(anonymous) @ VM1042 WAService.js:2
(anonymous) @ VM1042 WAService.js:2
app.js? [sm]:19 App onLaunch
VM1042 WAService.js:2 TypeError: $gwx is not a function
    at <anonymous>:9:41
    at doWhenAllScriptLoaded (appservice?t=1610162997604:3612)
    at HTMLScriptElement.scriptLoaded (appservice?t=1610162997604:3632)
    at HTMLScriptElement.script.onload (appservice?t=1610162997604:3640)
errorReport @ VM1042 WAService.js:2
thirdErrorReport @ VM1042 WAService.js:2
(anonymous) @ VM1042 WAService.js:2
I @ VM1042 WAService.js:2
n @ VM1042 WAService.js:2
(anonymous) @ VM1042 WAService.js:2
value @ VM1042 WAService.js:2
(anonymous) @ VM1042 WAService.js:2
doWhenAllScriptLoaded @ appservice?t=1610162997604:3612
scriptLoaded @ appservice?t=1610162997604:3632
script.onload @ appservice?t=1610162997604:3640
error (async)
(anonymous) @ VM1042 WAService.js:2
(anonymous) @ VM1042 WAService.js:2
(anonymous) @ VM1042 WAService.js:2
[sitemap 索引情况提示] 根据 sitemap 的规则[0],当前页面 [pages/index/index] 将被索引
[渲染层错误] SyntaxError: Unexpected token var
[渲染层错误] Uncaught
[渲染层错误] ReferenceError: $gwx is not defined
    at http://127.0.0.1:15520/__pageframe__/__dev__/wxappcode.js:3:30
[渲染层错误] ReferenceError: $gwx is not defined
    at <anonymous>:13:24
    at <anonymous>:31:21
    at <anonymous>:60:29
VM1042 WAService.js:2 Page "pages/index/index" has not been registered yet.
[渲染层错误] SyntaxError: Unexpected token var
[渲染层错误] Uncaught
[渲染层错误] ReferenceError: $gwx is not defined
    at http://127.0.0.1:15520/__pageframe__/__dev__/wxappcode.js:3:30
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值