Closed yuri-karadzhov closed 12 years ago
I'm having the same issue here.
This should be fixed in v0.1.5
. TJ changed Express so that there's no options.locals
by default when the template engine is called. The EJS render call still uses options.locals
so this library creates it now if it doesn't already exist, and then uses as before. This should be backwards compatible with other versions of Express 3.x, but I'm glad we're onto release candidates now!
Verified using Express 3 rc3 and version 0.1.5
It works fine with express3.0.0rc2 but when I update the project to new express3.0.0rc3 I've got an error
TypeError: Cannot read property 'blocks' of undefined at View.module.exports [as engine] (/var/www/lib/node_modules/ejs-locals/index.js:65:22) at View.render (/var/www/lib/node_modules/express/lib/view.js:75:8) at Function.app.render (/var/www/lib/node_modules/express/lib/application.js:504:10) at ServerResponse.res.render (/var/www/lib/node_modules/express/lib/response.js:677:7) at exports.index (/var/www/lib/routes/routes.js:271:7) at callbacks (/var/www/lib/node_modules/express/lib/router/index.js:165:11) at param (/var/www/lib/node_modules/express/lib/router/index.js:139:11) at pass (/var/www/lib/node_modules/express/lib/router/index.js:146:5) at Router._dispatch (/var/www/lib/node_modules/express/lib/router/index.js:173:5) at Object.router (/var/www/lib/node_modules/express/lib/router/index.js:33:10)