node-mustache-express
node-mustache-express copied to clipboard
Error occurs when multiple view folders are used
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!
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