Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template error is lacking some detail #1095

Closed
benjaminapetersen opened this issue Apr 10, 2018 · 3 comments
Closed

Template error is lacking some detail #1095

benjaminapetersen opened this issue Apr 10, 2018 · 3 comments

Comments

@benjaminapetersen
Copy link

Pretty simple express + nunjucks setup, code is:

app.get('/', (req, res) => {
  res.render(`views/index.html`, {
    title: 'Index.html',
    items: [
      {name: 'item 1'},
      {name: 'item 2'},
      {name: 'item 3'}
    ]
  });
});
Error: template not found: err.nunjucks
    at createTemplate (my_proj/node_modules/nunjucks/src/environment.js:274:15)
    at next (my_proj/node_modules/nunjucks/src/lib.js:283:7)
    at handle (my_proj/node_modules/nunjucks/src/environment.js:313:11)
    at my_proj/node_modules/nunjucks/src/environment.js:323:9
    at next (my_proj/node_modules/nunjucks/src/lib.js:281:7)
    at Object.asyncIter (my_proj/node_modules/nunjucks/src/lib.js:287:3)
    at Environment.getTemplate (my_proj/node_modules/nunjucks/src/environment.js:305:9)
    at Environment.render (my_proj/node_modules/nunjucks/src/environment.js:344:10)
    at NunjucksView.render (my_proj/node_modules/nunjucks/src/express-app.js:20:9)
    at tryRender (my_proj/node_modules/express/lib/application.js:640:10)

File is there. was sent as a static html file before adding nunjucks to the project. The error is pretty cryptic, should it tell me what template it isn't finding?

@evanre
Copy link

evanre commented May 8, 2018

+1

@Spown
Copy link

Spown commented May 8, 2018

I think it's all a part of a larger problem that was introduced some versions ago, where some error details are being lost / are not getting to output... Probably related to #1087

@fdintino
Copy link
Collaborator

This is now fixed in the 3.1.3 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants