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

Using a property called "settings" in the data passed to a view/template breaks the lib #153

Open
tomsotte opened this issue May 19, 2018 · 0 comments

Comments

@tomsotte
Copy link

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)
@tomsotte 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
@pillarjs pillarjs deleted a comment from thenickdude Jan 26, 2021
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

1 participant