I am trying to include a simple partial template in my ejs file. I watched several tutorials explaining how to do that and I see no difference between their code and mine. I also checked the path a few times, but I'm always getting the same error:
SyntaxError: Unexpected identifier in C:\Users\Leandro.DESKTOP-C1AK72S\Documents\Visual Studio Code GitHub\Server\views\preview.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 (C:\Users\Leandro.DESKTOP-C1AK72S\Documents\Visual Studio Code GitHub\Server\node_modules\ejs\lib\ejs.js:626:12)
at Object.compile (C:\Users\Leandro.DESKTOP-C1AK72S\Documents\Visual Studio Code GitHub\Server\node_modules\ejs\lib\ejs.js:366:16)
at handleCache (C:\Users\Leandro.DESKTOP-C1AK72S\Documents\Visual Studio Code GitHub\Server\node_modules\ejs\lib\ejs.js:215:18)
at tryHandleCache (C:\Users\Leandro.DESKTOP-C1AK72S\Documents\Visual Studio Code GitHub\Server\node_modules\ejs\lib\ejs.js:254:16)
at View.exports.renderFile [as engine] (C:\Users\Leandro.DESKTOP-C1AK72S\Documents\Visual Studio Code GitHub\Server\node_modules\ejs\lib\ejs.js:459:10)
at View.render (C:\Users\Leandro.DESKTOP-C1AK72S\Documents\Visual Studio Code GitHub\Server\node_modules\express\lib\view.js:135:8)
at tryRender (C:\Users\Leandro.DESKTOP-C1AK72S\Documents\Visual Studio Code GitHub\Server\node_modules\express\lib\application.js:640:10)
at Function.render (C:\Users\Leandro.DESKTOP-C1AK72S\Documents\Visual Studio Code GitHub\Server\node_modules\express\lib\application.js:592:3)
at ServerResponse.render (C:\Users\Leandro.DESKTOP-C1AK72S\Documents\Visual Studio Code GitHub\Server\node_modules\express\lib\response.js:1012:7)
This is the code snippet:
<% include partials/timerWidget.ejs %>
Removing this line of code, the error is gone