node-mustache-express icon indicating copy to clipboard operation
node-mustache-express copied to clipboard

Error occurs when multiple view folders are used

Open byongshintv opened this issue 3 years ago • 1 comments

Hello,

As of Express 4.10, we can put an array of view folders in the second parameter of app.set('views'). However, when used like this, an unhandled exception occurs when syntax such as {{>head}} is used in the mustache file.

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array
    at new NodeError (node:internal/errors:393:5)
    at validateString (node:internal/validators:161:11)
    at Object.resolve (node:path:167:9)
    at project\node_modules\mustache-express\mustache-express.js:101:24
    at project\node_modules\async\dist\async.js:246:13

I feel the need to modify the source considering when the partialsDirectory variable is received as an array.

Thanks!

byongshintv avatar Jan 02 '23 01:01 byongshintv

Hey,

Thanks for reporting this. If you have some idea on how to fix it: feel free to submit a PR. Unless you can you show me how can I reproduce this?

Thanks

faust64 avatar Jan 03 '23 22:01 faust64