That error really doesn't look like it came from a browser. The presence of /Users/node_modules/ejs/lib/ejs.js
and other node.js and Express things in the stack trace suggests that the errors are coming from the server. A lot of things use <% ... %>
for templates, perhaps your server-side code is one of those things and the error is actually coming from your server.
A quick and easy way to find out (and possibly solve the problem) would be to change the template delimiters. You can use different regexes with Underscore by setting _.templateSettings
values:
If ERB-style delimiters aren't your cup of tea, you can change Underscore's template settings to use different symbols to set off interpolated code. Define an interpolate regex to match expressions that should be interpolated verbatim, an escape regex to match expressions that should be inserted after being HTML escaped, and an evaluate regex to match expressions that should be evaluated without insertion into the resulting string.
So you could add this to your client-side code:
_.templateSettings = {
evaluate : /\{\{([\s\S]+?)\}\}/g,
interpolate : /\{\{=([\s\S]+?)\}\}/g,
escape : /\{\{-([\s\S]+?)\}\}/g
};
and then use {{ ... }}
, {{= ... }}
, and {{- ... }}
in your template to get Handlebar-ish templates. Be sure to define all three regexes and make sure they don't overlap in unexpected ways.