admin管理员组文章数量:1321074
My ejs file path does not work.
SyntaxError: Unexpected token '/' in C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\views\landing.ejs while piling ejs
If the above error is not helpful, you may want to try EJS-Lint: Or, if you meant to create an async function, pass
async: true
as an option. at new Function () at Templatepile (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:626:12) at Objectpile (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:366:16) at handleCache (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:215:18) at tryHandleCache (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:254:16) at View.exports.renderFile [as engine] (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:459:10) at View.render (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\view.js:135:8) at tryRender (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\application.js:640:10) at Function.render (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\application.js:592:3) at ServerResponse.render (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\response.js:1012:7) at C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\app.js:43:9 at Layer.handle [as handle_request] (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\layer.js:95:5) at next (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\layer.js:95:5) at C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\index.js:281:22
Here is my code
Here is my folder structure
enter image description here enter image description here enter image description here
enter image description here Can somebody solve this issue?
My ejs file path does not work.
SyntaxError: Unexpected token '/' in C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\views\landing.ejs while piling ejs
If the above error is not helpful, you may want to try EJS-Lint: https://github./RyanZim/EJS-Lint Or, if you meant to create an async function, pass
async: true
as an option. at new Function () at Template.pile (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:626:12) at Object.pile (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:366:16) at handleCache (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:215:18) at tryHandleCache (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:254:16) at View.exports.renderFile [as engine] (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\ejs\lib\ejs.js:459:10) at View.render (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\view.js:135:8) at tryRender (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\application.js:640:10) at Function.render (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\application.js:592:3) at ServerResponse.render (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\response.js:1012:7) at C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\app.js:43:9 at Layer.handle [as handle_request] (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\layer.js:95:5) at next (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\layer.js:95:5) at C:\Users\mikda\Desktop\ColtFULL\Section33\YelpCamp\v3\node_modules\express\lib\router\index.js:281:22
Here is my code
Here is my folder structure
enter image description here enter image description here enter image description here
enter image description here Can somebody solve this issue?
Share Improve this question edited Nov 29, 2019 at 12:08 MIk Mik asked Nov 29, 2019 at 11:07 MIk MikMIk Mik 211 silver badge5 bronze badges 2- 1 Possible duplicate: stackoverflow./questions/5813771/… – Snickbrack Commented Nov 29, 2019 at 11:15
- Possible duplicate of In EJS template engine, how do I "include" a footer? – Pankwood Commented Nov 29, 2019 at 15:08
1 Answer
Reset to default 8In your code for landing.ejs
replace:
<%- include ./partials/header %>
with this:
<%- include ('./partials/header') %>
and do the same for the footer also.
本文标签: javascriptSyntaxError Unexpected tokenejs while compiling ejsStack Overflow
版权声明:本文标题:javascript - SyntaxError: Unexpected token.ejs while compiling ejs - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742090585a2420242.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论