比较新的的开发工具在启动设置中新增一个错误路径,不会触发 onPageNotFound,老版本的开发工具可以。
thirdScriptError onPageNotFound error: page "health-info" is not found.; at onPageNotFound Error: onPageNotFound error: page "health-info" is not found. at WAService.js:1:872524 at WAService.js:1:458059 at n (http: //127.0.0.1:47787/appservice/__dev__/asdebug.js:1:3175) at e.exports.<anonymous> (http: //127.0.0.1:47787/appservice/__dev__/asdebug.js:1:3555) at http: //127.0.0.1:47787/appservice/__dev__/asdebug.js:1:1968 at Array.forEach (<anonymous>) at WebSocket._ws.onmessage (http: //127.0.0.1:47787/appservice/__dev__/asdebug.js:1:1950) |
Page "health-info" has not been registered yet.
并没有我在onPageNotFound 中打印的log信息
onPageNotFound error: page "page/component/pages/swiper/swiper" is not分享之后打开这样
1、启动一个项目,在 app.js 中添加:
onPageNotFound(e) {
console.error(
'onPageNotFound'
, e)
}
2、然后随便添加一个不存在的路径,如下:
3、然后会出现下面的界面,但是没有触发 onPageNotFound 方法:
新版本开发工具已修复
这里具体是怎么写的?麻烦提供能复现问题的代码片段看下(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)