Missing Catch or Finally After Try

The error was a missing bracket on an if statement in my EJS template. As that trace shows, it was in the exports.compile function (which is called by res.render()) that this error occurs) - the lib author uses a string to create a new function, which encloses my EJS file functionality in a try block, which becomes a dangling try because my missing opening bracket in my if block caused a syntax error in the new anonymous function created as a string and built with "new Function('str')".

@T.J.Crowder pointed out, that stack trace is perfectly clear, and did ultimately lead to this solution. I removed some of my example code because it definitely wasn't linked to the ultimate problem.


For me it was a missing { on the below for loop caused the error. Look for proper closing or opening of paranthesis.

<% for(var i=0;i<users.length;i++) %>   
    <li> <%= users[i]   %>  </li>
    <%}%>
    </ul>
    </p>