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
Using a property called "settings" in the data passed to a view/template breaks the app.
As far as I've investigated the settings property is used by hbs.js in the middleware function.
If the data passed to the render function of view.js contains alreayd a property settings is doesn't get used correctly, and some information is missing, particularly the view directories (view_dirs in hbs.js).
I'm using hbs as a template engine for expressjs. It all starts as a call for res.render():
...
res.render('settings',{settings: {...}});
...
The error calls stack in detail:
TypeError: Path must be a string. Received undefined
at assertPath (path.js:28:11)
at Object.join (path.js:1236:7)
at /app/node_modules/hbs/lib/hbs.js:117:26
at Array.map (<anonymous>)
at Instance.middleware (/app/node_modules/hbs/lib/hbs.js:115:46)
at View.render (/app/node_modules/express/lib/view.js:135:8)
at tryRender (/app/node_modules/express/lib/application.js:641:10)
at Function.render (/app/node_modules/express/lib/application.js:593:3)
at ServerResponse.render (/app/node_modules/express/lib/response.js:1008:7)
at exports.get (/app/routes/controllers/settings.js:30:6)
The text was updated successfully, but these errors were encountered:
tomsotte
changed the title
Using a property called "settings" in the data passed to a view/template breaks the app.
Using a property called "settings" in the data passed to a view/template breaks the lib
May 19, 2018
Using a property called "settings" in the data passed to a view/template breaks the app.
As far as I've investigated the
settings
property is used byhbs.js
in themiddleware
function.If the data passed to the
render
function ofview.js
contains alreayd a propertysettings
is doesn't get used correctly, and some information is missing, particularly the view directories (view_dirs
inhbs.js
).I'm using
hbs
as a template engine forexpressjs
. It all starts as a call forres.render()
:The error calls stack in detail:
The text was updated successfully, but these errors were encountered: