用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