You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i try to pass locals to both layout and template i get a strange error
layout_content is not defined at eval (eval at compile (C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:577:12), <anonymous>:10:8) at returnedFn (C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:606:17) at Object.exports.renderFile (C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:417:31) at C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:1103:28 at Object.exports.renderFile (C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:423:10) at View.exports.main [as engine] (C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:1100:11)
when i try to pass locals to both layout and template i get a strange error
layout_content is not defined at eval (eval at compile (C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:577:12), <anonymous>:10:8) at returnedFn (C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:606:17) at Object.exports.renderFile (C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:417:31) at C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:1103:28 at Object.exports.renderFile (C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:423:10) at View.exports.main [as engine] (C:\Users\Farmy\Documents\github\laboratory_website\bakcend\express\node_modules\ejs-layout\lib\ejs.js:1100:11)
my code:
router:js:
res.render('index', { currentRoute: 'test', layout_content: req.ejs.layout_content, page_content: custom_content });
layout.ejs:
<title><% layout_content.title %></title> <%- defineContent('body') %>
main.ejs:
<p><% layout_content.text%></p>
The text was updated successfully, but these errors were encountered: