Skip to content

setting views option as an array of paths gives an error #3976

@Jusys

Description

@Jusys

Using node v12.2.0
Using express v4.17.1
Using express-handlebars v3.0.2
Using Windows 7

Documentation clearly states, that:
image

My code is like:
let _views = ['some-path/views1']
_ex.set('views', _views)

But when I try to use an array of view paths I get an error:

TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received type object
    at validateString (internal/validators.js:107:11)
    at Object.relative (path.js:434:5)
    at ExpressHandlebars.renderView (c:\my-project\node_modules\express-handlebars\lib\express-handlebars.js:193:43)
    at View.render (c:\my-project\node_modules\express\lib\view.js:135:8)
    at tryRender (c:\my-project\node_modules\express\lib\application.js:640:10)
    at Function.render (c:\my-project\node_modules\express\lib\application.js:592:3)
    at ServerResponse.render (c:\my-project\node_modules\express\lib\response.js:1012:7)
    at c:\my-project\web\views\main-default.js:6:10
    at Layer.handle [as handle_request] (c:\my-project\node_modules\express\lib\router\layer.js:95:5)
    at next (c:\my-project\node_modules\express\lib\router\route.js:137:13)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions