ejs throws error ` <%= ":" _ %>` for a space between _ and %> - SyntaxError: missing ) after argument list
See original GitHub issueI had this error thrown by ejs which ejs-lint couldn’t detect.
err SyntaxError: missing ) after argument list in C:\model.ts while compiling ejs
If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
for a code like,
<%= ":" _ %>
First of all it should not throw an error as this code has both <% and %>. But this ejs detects this space (’ ') between _ %> and throws an error.
It could be a meaning full error , may be like , its missing a closing ‘%>’ - would be more appropriate.
But it was very hard for me to locate this little space in the large file!
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
SyntaxError: missing ) after argument list - JavaScript | MDN
The JavaScript exception "missing ) after argument list" occurs when there is an error with how a function is called. This might be...
Read more >SyntaxError: missing ) after argument list in while compiling ejs
I tried many times, but I can't find the problem. Here's the ejs that causes errors. What is the problem with this code?...
Read more >syntaxerror: missing ) after argument list in while compiling ejs
The JavaScript exception "missing) after argument list" occurs when there is an error with how a function is called. This might be a...
Read more >JavaScript SyntaxError - Missing ) after argument list
This JavaScript exception missing ) after argument list occurs if there is an error in function calls. This could be a typing mistake,...
Read more >How to use EJS to template your Node.js application
Template your Node.js apps with EJS, a simple and powerful templating engine that generates HTML markup from JavaScript quickly and easily.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In this case, the error is not coming from the EJS tag-matching code. It an ordinary JavaScript
SyntaxError
being thrown trying to parse":" _
, which is not valid JavaScript. This is not something ejs-lint can lint for – it’s actually valid EJS tags, just invalid JavaScript inside them. I agree it’s not a super-helpful error message, and sounds like it was difficult to find. I understand how frustrating that is. Since this isn’t an error specific to EJS, I’m going to go ahead and close this issue.<% if(kindOfDay === “Saturday” || kindOfDay === “Sunday”){ %>
<%= kindOfDay%> ToDo List
<% } else %> {<%= kindOfDay%> ToDO List
<% } %> SyntaxError: Missing catch or finally after try in C:\Users\Admin\desktop\to-do-list\views\List.ejs while compiling ejsIf the above error is not helpful, you may want to try EJS-Lint: