uniapp报$gwx is not a function错误

2019-09-21 14:00:26

最近在做uniapp应用时遇到一个错误,记录一下

运行到手机时的错误信息:

[错误] ./pages/tabBar/do_diagnosis/do_diagnosis.wxml:1:4575: unexpected character `�`
12:27:14.960 [错误] ./pages/tabBar/do_diagnosis/do_diagnosis.wxml:1:4575: unexpected character `�`
12:27:15.025  DONE  Build complete. Watching for changes...
12:27:15.026 项目 'fish_diagnosis' 编译成功.
12:27:15.058 正在同步手机端程序文件...
12:27:15.463 同步手机端程序文件完成
12:27:15.488 正在重启,如手机上HBuilder调试基座未启动,请手动启动...
12:27:15.968 TypeError: $gwx is not a function
12:27:15.993 at file:///storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/www/app-view.js:115:27 at uniapp://ready:182
12:27:16.017 webviewScriptError
12:27:16.041 $gwx is not a function
12:27:16.064 TypeError: $gwx is not a function
12:27:16.092 at file:///storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/www/app-view.js:115:27 at uniapp://ready:182
12:27:16.113 Uncaught TypeError: $gwx is not a function at app-view.js:115

问题点是 unexpected character ,几番搜之后
最后发现是页面有几处字符 '< '导致的编译出错。。删掉后就通过编译可以运行到手机了

其它有可能就是中文变量导致的错误

参考回答:

本文链接:
版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC-ND 3.0 许可协议。可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。

扫描下方二维码阅读当前文章

浏览器、微信扫码

评 论:

好文推荐
每天进步一点点~