- 当前 Bug 的表现(可附上截图)
Please do not register multiple Pages in pages/jxtz/jxtz.js
console.error @ VM401:1
t.error @ WAService.js:18
t.pageHolder @ WAService.js:17
(anonymous) @ jxtz.js? [sm]:21
require @ WAService.js:18
(anonymous) @ VM485:43
scriptLoaded @ appservice?t=1535783084650:3908
VM401:1 thirdScriptError
sdk uncaught third Error
APP-SERVICE-Engine:Please do not register multiple Pages in pages/jxtz/jxtz.js
Error: APP-SERVICE-Engine:Please do not register multiple Pages in pages/jxtz/jxtz.js
at new t (http://127.0.0.1:16149/appservice/__dev__/WAService.js:18:889)
at t.pageHolder (http://127.0.0.1:16149/appservice/__dev__/WAService.js:17:18737)
at http://127.0.0.1:16149/appservice/pages/jxtz/jxtz.js:23:1
at require (http://127.0.0.1:16149/appservice/__dev__/WAService.js:18:27248)
at <anonymous>:43:7
at HTMLScriptElement.scriptLoaded (http://127.0.0.1:16149/appservice/appservice?t=1535783084650:3908:23)
页面不可操作:报错如下
VM401:1 Page[pages/wellcome/wellcome] not found. May be caused by: 1. Forgot to add page route in app.json. 2. Invoking Page() in async task.
console.warn @ VM401:1
t.warn @ WAService.js:18
D @ WAService.js:17
q @ WAService.js:17
K @ WAService.js:17
(anonymous) @ WAService.js:17
(anonymous) @ WAService.js:18
(anonymous) @ WAService.js:5
(anonymous) @ WAService.js:5
(anonymous) @ WAService.js:4
a @ appservice?t=1535783084650:3396
d.registerCallback @ appservice?t=1535783084650:3396
n.forEach @ appservice?t=1535783084650:3396
d @ appservice?t=1535783084650:3396
k.onmessage @ appservice?t=1535783084650:3396
WAService.js:18 Sat Sep 01 2018 14:24:47 GMT+0800 (中国标准时间) 事件警告
VM401:1 Do not have login handler in current page: pages/wellcome/wellcome. Please make sure that login handler has been defined in pages/wellcome/wellcome, or pages/wellcome/wellcome has been added into app.json
console.warn @ VM401:1
t.warn @ WAService.js:18
z @ WAService.js:17
(anonymous) @ WAService.js:17
(anonymous) @ WAService.js:18
(anonymous) @ WAService.js:6
e.(anonymous function) @ WAService.js:4
a @ appservice?t=1535783084650:3396
e.registerCallback @ appservice?t=1535783084650:3396
n.forEach @ appservice?t=1535783084650:3396
d @ appservice?t=1535783084650:3396
k.onmessage @ appservice?t=1535783084650:3396
开发工具调试
- 预期表现
- 复现路径
- 提供一个最简复现 Demo
我也报这样的错误了,后来发现是引入了另一个Page的js,所以导致有两个Page,当时不知道,所以一直没找到错误。
我这里css导入带来了这个问题
一行代码没改,昨天好的,今天就报这个错了。
都2023年了还有这个问题。官方都不解决的吗?
我也是更新了开发者工具1.02.1812180 版本后 莫名出现的bug,代码是 真机模拟 上运行没有问题,就是点击预览在手机上看就会出现这样的问题 ,我把在线上运行没问题的代码拉下预览一遍 还是会有这样的问题
请问解决了问题吗?到底是怎么回事?我也是,顺手更新了工具就报错,很头疼
删除pages/jxtz/jxtz.js的文件下的Page({})或Component({})试一下
page({})是有的,但是不是这个原因,网上说的app.json排序也不行,app.js中也没有page({}),最后成功解决,吧代码复制到记事本,然后新建了js,wxml,json,wxss文件,然后黏贴回去,正常了。也给后面的人留个灯,如果你的代码之前正常,突然抽风可能是这个原因。另外想到这个方法是在查看错误的时候直接点 at http://127.0.0.1:16149/appservice/pages/jxtz/jxtz.js:23:1发现第一行代码不是第一行是第三行,中间有两行并不是自己写的代码,切直接在js中看不到,于是想到这个方法。
我也是升级到1.02.1808300这个版本就出现这种情况,按照你说的方法也不行。郁闷了
这个报错我以前遇到过,就是在引用的js文件里删除page({})或component({})试一下,
没事,慢慢来挨个确认代码,如果都没有问题,最后哪个代码块儿有问题,有挨句注释查看,总会找到原因的。相对那些前辈们,我们已经少走好多弯路了
我引用需要js主动调用的组件时,就报这个问题。如果删掉component({}),那么组件不就用不了了?