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
Hi, I have express-handlebars 2.0.0 on express 4.12.3, and I think I've discovered a bug.
The aforementioned TypeError gets raised when I try and render a view. The line that seems to be causing it is line 193 of express-handlebars.js: view = this._getTemplateName(path.relative(viewsPath, viewPath)). Since I've passed an array to app.set('views'), viewsPath is also an array, and thus raises that error. I'd try and fix it myself, but I don't really know how I'd go about that.
Just in case it helps, here is my index.js (the error occurs when I visit /resonate/bts/editor):
Makes sense that you'd get a type error when setting views to an array based on the current implementation of renderView(). This is also related to #112.
To support views being an array this code would need to be refactored. A new private method could be added to resolve view name, it could iterate over the views array until it finds a path which is contained in the viewPath string (indexOf === 0).
Hi, I have express-handlebars 2.0.0 on express 4.12.3, and I think I've discovered a bug.
The aforementioned TypeError gets raised when I try and render a view. The line that seems to be causing it is line 193 of express-handlebars.js:
view = this._getTemplateName(path.relative(viewsPath, viewPath))
. Since I've passed an array toapp.set('views')
,viewsPath
is also an array, and thus raises that error. I'd try and fix it myself, but I don't really know how I'd go about that.Just in case it helps, here is my index.js (the error occurs when I visit /resonate/bts/editor):
Any ideas would be fantastic, thank you!
The text was updated successfully, but these errors were encountered: