1

njk を 2.4.2 にアップグレードした後、エクスプレスとノードで nunjucks2 を使用しています。次のエラーが発生します。

Template render error: (/home/aien/Web/Test/express/views/error.html)
 Template render error: (/home/aien/Web/Test/express/views/layout.html) [Line 56, Column 20]
 expected block end in block statement
   at Object.exports.prettifyError (/home/aien/Web/Test/express/node_modules/nunjucks/src/lib.js:34:15)
   at /home/aien/Web/Test/express/node_modules/nunjucks/src/environment.js:485:31
   at root [as rootRenderFunc] (eval at <anonymous> (/home/aien/Web/Test/express/node_modules/nunjucks/src/environment.js:564:24), <anonymous>:25:3)
   at Obj.extend.render (/home/aien/Web/Test/express/node_modules/nunjucks/src/environment.js:478:15)
   at /home/aien/Web/Test/express/node_modules/nunjucks/src/environment.js:311:35
   at Obj.extend.getTemplate (/home/aien/Web/Test/express/node_modules/nunjucks/src/environment.js:194:17)
   at Obj.extend.render (/home/aien/Web/Test/express/node_modules/nunjucks/src/environment.js:303:14)
   at NunjucksView.render (/home/aien/Web/Test/express/node_modules/nunjucks/src/environment.js:284:15)
   at tryRender (/home/aien/Web/Test/express/node_modules/express/lib/application.js:639:10)
   at EventEmitter.render (/home/aien/Web/Test/express/node_modules/express/lib/application.js:591:3)

エラーとレイアウトは単純な nunjucks ファイルです。ここに構成を投稿しますapp.js

app.set('views', path.join(__dirname, 'views'));
nunjucks.configure('views', {
  express: app,
  autoescape: true
});

app.set('view engine', 'html');
4

1 に答える 1