sunshine
管理员
管理员
  • 最后登录2023-10-30
  • 发帖数170
  • 社区居民
阅读:15424回复:0

[微信小程序]微信小程序出错:index.js:1 Uncaught ReferenceError: define is not defined(anonymous function)

楼主#
更多 发布于:2017-12-29 16:16
新建了一个小程序模板,然后,什么也没有改,直接运行,却提示如下错误:

微信小程序出错:index.js:1 Uncaught ReferenceError: define is not defined(anonymous function)

index.js:1 Uncaught ReferenceError: define is not defined(anonymous function) @ index.js:1
util.js:1 Uncaught ReferenceError: define is not defined(anonymous function) @ util.js:1
app.js:1 Uncaught ReferenceError: define is not defined(anonymous function) @ app.js:1
index.js:1 Uncaught ReferenceError: define is not defined(anonymous function) @ index.js:1
appservice:16 Mon Jul 31 2017 20:37:22 GMT+0800 (CST) page 编译错误
appservice:17  pages/index/index 出现脚本错误或者未正确调用 Page()(anonymous function) @ appservice:17
logs.js:1 Uncaught ReferenceError: define is not defined(anonymous function) @ logs.js:1
appservice:22 Mon Jul 31 2017 20:37:22 GMT+0800 (CST) page 编译错误
appservice:23  pages/logs/logs 出现脚本错误或者未正确调用 Page()(anonymous function) @ appservice:23
customerNew.js:1 Uncaught ReferenceError: define is not defined(anonymous function) @ customerNew.js:1
appservice:28 Mon Jul 31 2017 20:37:22 GMT+0800 (CST) page 编译错误
appservice:29  pages/customer/customerNew 出现脚本错误或者未正确调用 Page()(anonymous function) @ appservice:29

图片:error.png





解决方案:
网上找了一个解决方案
设置不使用代理:
不使用任何代理,勾选后直连网络

然后重启微信web开发者工具后,该问题就消失了。
但是,工具连最上面的设置点击都没有反应,最后,试了一下。点击右上角的点击,然后在项目设置时,把不校验安全域名,还有其它的勾选,都取消,然后,重启微信. 在把你想要的勾上,就好了。

图片:代理.png



参考:https://www.crifan.com/weixin_microapp_index_js_uncaught_referenceerror_define_is_not_defined_anoymous_function/
游客


返回顶部

公众号

公众号