Gav*_*vin 6 javascript node.js express
我正在将Node模板转换为Node.js/Express中的EJS.模板文件有点复杂,因此调试它们并不容易.Node没有给我任何有用的调试信息,因此它几乎不可能完成这项任务.这是一个示例错误消息.
SyntaxError: Unexpected string in "app/views/profile/index.ejs"
at Object.Function (<anonymous>)
at exports.compile (/Users/Gavin/Web/node_modules/ejs/lib/ejs.js:237:14)
at Object.exports.render (/Users/Gavin/Web/node_modules/ejs/lib/ejs.js:284:10)
at View.exports.renderFile [as engine] (/Users/Gavin/Web/node_modules/ejs/lib/ejs.js:318:20)
at View.render (/Users/Gavin/Web/node_modules/express/lib/view.js:76:8)
at Function.app.render (/Users/Gavin/Web/node_modules/express/lib/application.js:502:10)
at ServerResponse.res.render (/Users/Gavin/Web/node_modules/express/lib/response.js:777:7)
at Object.exports.profile_index [as handle] (/Users/Gavin/Web/app/controllers/routes/profile.js:72:6)
at next_layer (/Users/Gavin/Web/node_modules/express/lib/router/route.js:103:13)
at Object.exports.verify_user [as handle] (/Users/Gavin/Web/app/controllers/routes/account.js:305:10)
Run Code Online (Sandbox Code Playgroud)
找到这种模糊错误消息的来源非常繁琐.有没有更简单的方法来调试EJS文件?
| 归档时间: |
|
| 查看次数: |
862 次 |
| 最近记录: |