> I'm playing around a bit with the Express framework and EJS and I get
> this error:
>
> at Object.Function (unknown source)
> at Object.compile (/Users/tim/Sites/curatica/node_modules/ejs/lib/
> ejs.js:198:12)
I use Jade but got a similar error that I was baffled by for awhile. In my case it meant there was a syntax error in my view (or layout).
> at Function.compile (/Users/tim/Sites/curatica/node_modules/express/
> lib/view.js:65:33)
> at ServerResponse._render (/Users/tim/Sites/curatica/node_modules/
> express/lib/view.js:414:18)
> at ServerResponse.render (/Users/tim/Sites/curatica/node_modules/
> express/lib/view.js:315:17)
> at Promise. (/Users/tim/Sites/curatica/app.js:43:7)
> at Promise. (/Users/tim/Sites/curatica/node_modules/mongoose/lib/
> promise.js:120:8)
> at Promise. (events.js:64:17)
> at Promise.emit (/Users/tim/Sites/curatica/node_modules/mongoose/lib/
> promise.js:59:38)
> at Promise.complete (/Users/tim/Sites/curatica/node_modules/mongoose/
> lib/promise.js:70:20)
>
> This is my view template:
>
> <h1><%= title %></h1>
> <ul>
> <% users.forEach(function(user) { -%>
> <li><%= user.nickname %></li>
> <% }); -%>
> </ul>
I haven't used ejs myself so I don't know whether this is valid syntax or not. But based on this example...
https://github.com/visionmedia/ejs/blob/master/examples/list.ejs
...I'd say the "-" before the closing "%>" tags should not be there.
--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.