Can no longer render templates in Ubuntu

34 views
Skip to first unread message

Brad Grant

unread,
Aug 31, 2015, 10:17:55 AM8/31/15
to Nunjucks
Something has happened during an update on our Ubuntu server machine that now causes all attempts at rendering templates to fail.  It says it cannot find the template file.  It worked before doing a fresh npm install to update some packages.  Our Nunjucks version is at 1.0.7.  My configuration did not change and is:

nunjucks.configure('/opt/nodejs/server/templates', { autoescape: true });

The templates directory has all template files in it and always has.  It has been working fine for years and only broke this weekend with a node update but no code changes on our end.

The same system, package.json and our app code, works on our OS/X development box.  It is only broken on the Ubuntu server.  However, if I change the nunjucks.render('template.nhtml', data) to nunjucks.renderString(templateFileContentsInStringVar, data) then it works as always.

The error message says it is failed on line 82 of mysql Parser.js:

/Users/me/Node.js/ionmed/node_modules/mysql/lib/protocol/Parser.js:82
        throw err;
              ^
Error: template not found: template.nhtml
    at null.<anonymous> (/Users/me/Node.js/ionmed/node_modules/nunjucks/src/environment.js:154:31)
    at next (/Users/me/Node.js/ionmed/node_modules/nunjucks/src/lib.js:201:13)
    at handle (/Users/me/Node.js/ionmed/node_modules/nunjucks/src/environment.js:139:25)
    at /Users/me/Node.js/ionmed/node_modules/nunjucks/src/environment.js:150:21
    at next (/Users/me/Node.js/ionmed/node_modules/nunjucks/src/lib.js:198:13)
    at Object.exports.asyncIter (/Users/me/Node.js/ionmed/node_modules/nunjucks/src/lib.js:205:5)
    at Obj.extend.getTemplate (/Users/me/Node.js/ionmed/node_modules/nunjucks/src/environment.js:133:17)
    at Obj.extend.render (/Users/me/Node.js/ionmed/node_modules/nunjucks/src/environment.js:214:14)
    at Object.module.exports.render (/Users/me/Node.js/ionmed/node_modules/nunjucks/index.js:58:14)
    at Query._callback (/Users/me/Node.js/ionmed/routes/reports.js:2332:79)

Just as if you specify a template filename that is not there.  However, this file has always been and is still there.  Please help.
Reply all
Reply to author
Forward
0 new messages