浏览器访问时报not found错误
来源:2-2 环境搭建下

慕慕804234
2020-01-10
> satety_code@1.0.0 start /Users/admin/Documents/zhaoxuhua/autotest/satety_code
> node server.js
App http is listening on port 1521
enter site.js
(node:65783) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
at eval (eval at wrap (/Users/admin/Documents/zhaoxuhua/autotest/satety_code/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:10:246)
at template (eval at wrap (/Users/admin/Documents/zhaoxuhua/autotest/satety_code/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:48:404)
at KoaPug.compileFile (/Users/admin/Documents/zhaoxuhua/autotest/satety_code/node_modules/koa-pug/dist/index.js:92:66)
(node:65783) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:65783) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
enter site.js
一直没有找到这个id到底是哪个文件里的输入正文
1回答
-
TooooBug
2020-01-13
看起来是模板编译错误。对模板有做过什么修改吗?
也可以先确认一下数据有没有问题,有可能是数据有问题,在循环输出的时候读取出错。
122020-01-14
相似问题