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
koa-hbs converts user given viewPath to an array if it's a string:
if (!Array.isArray(this.viewPath)) {
this.viewPath = [this.viewPath];
}
Then in getLayoutPath(), if layoutsPath is not defined, this.viewPath is given as a parameter to path.join. Which in latest Node leads to:
TypeError: Path must be a string. Received [ '/Users/ilkkao/git/mas/server/views' ]
at assertPath (path.js:7:11)
at Object.join (path.js:1213:7)
at Hbs.getLayoutPath (/Users/ilkkao/git/mas/node_modules/koa-hbs/index.js:219:15)
https://github.com/gilt/koa-hbs/blob/master/index.js#L219 line seems problematic. It doesn't do the right thing if the viewPath is an array even with node <6 I think. Older node versions return a comma separated list of paths. That will lead to file not found.
The text was updated successfully, but these errors were encountered:
this is a good find, thanks. not sure if I'll have time to get tests in place and make a fix until the weekend - if you'd like to create a PR in the meantime it'd be welcome!
Related to this: nodejs/node#1215
koa-hbs converts user given
viewPath
to an array if it's a string:Then in
getLayoutPath()
, iflayoutsPath
is not defined,this.viewPath
is given as a parameter topath.join
. Which in latest Node leads to:https://github.com/gilt/koa-hbs/blob/master/index.js#L219 line seems problematic. It doesn't do the right thing if the
viewPath
is an array even with node <6 I think. Older node versions return a comma separated list of paths. That will lead to file not found.The text was updated successfully, but these errors were encountered: