SyntaxError: Unexpected identifier in /app/views/index.ejs while compiling ejs
If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
Or, if you meant to create an async function, pass `async: true` as an option.
at new Function (<anonymous>)
at Template.compile (/rbd/pnpm-volume/2eff2852-02dc-4dbe-aca7-c1f063351c14/node_modules/.registry.npmjs.org/ejs/3.0.1/node_modules/ejs/lib/ejs.js:626:12)
at Object.compile (/rbd/pnpm-volume/2eff2852-02dc-4dbe-aca7-c1f063351c14/node_modules/.registry.npmjs.org/ejs/3.0.1/node_modules/ejs/lib/ejs.js:366:16)
at handleCache (/rbd/pnpm-volume/2eff2852-02dc-4dbe-aca7-c1f063351c14/node_modules/.registry.npmjs.org/ejs/3.0.1/node_modules/ejs/lib/ejs.js:215:18)
at tryHandleCache (/rbd/pnpm-volume/2eff2852-02dc-4dbe-aca7-c1f063351c14/node_modules/.registry.npmjs.org/ejs/3.0.1/node_modules/ejs/lib/ejs.js:254:16)
at View.exports.renderFile [as engine] (/rbd/pnpm-volume/2eff2852-02dc-4dbe-aca7-c1f063351c14/node_modules/.registry.npmjs.org/ejs/3.0.1/node_modules/ejs/lib/ejs.js:459:10)
at View.render (/rbd/pnpm-volume/2eff2852-02dc-4dbe-aca7-c1f063351c14/node_modules/.registry.npmjs.org/express/4.17.1/node_modules/express/lib/view.js:135:8)
at tryRender (/rbd/pnpm-volume/2eff2852-02dc-4dbe-aca7-c1f063351c14/node_modules/.registry.npmjs.org/express/4.17.1/node_modules/express/lib/application.js:640:10)
at Function.render (/rbd/pnpm-volume/2eff2852-02dc-4dbe-aca7-c1f063351c14/node_modules/.registry.npmjs.org/express/4.17.1/node_modules/express/lib/application.js:592:3)
at ServerResponse.render (/rbd/pnpm-volume/2eff2852-02dc-4dbe-aca7-c1f063351c14/node_modules/.registry.npmjs.org/express/4.17.1/node_modules/express/lib/response.js:1012:7)
Welcome to the forum @MR.Nak
We might be able to help if you provide a github repo or a live demo of your work-in-progress. The error message is unfortunately not enough to understand the context of your application. We can only grasp that the issue is in the index.ejs
file.
its not only in index.ejs, its in all the pages
Try it this way:
<%- include (‘partials/header.ejs’); -%>
...
<%- include ('partials/footer.ejs'); -%>