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
I took the same example from handlebars.js from their repository and started the project on a Windows 10 PC. The problem is when trying to include the templates it gives me this error:
[plugin:@vituum/vite-plugin-handlebars] The partial templates/Layout/Main.hbs could not be found
Seems to be a windows problem with paths and backslashes.
the problem seems to be from the @vituum/vite-plugin-handlebars package in this line of code: const partialGlob = !options.partials.directory ? ${options.root}/**/*.hbs : ${resolve(process.cwd(), options.partials.directory)}/**/*.hbs
and the solution seems to normalize the path: const partialGlob = (!options.partials.directory ? ${options.root}/**/*.hbs : ${resolve(process.cwd(), options.partials.directory)}/**/*.hbs).replace(/\\/g, '/') const partialName = relative(partialDir, path).replace(/\\/g, '/')
please need to update the package as soon as possible. Thank you for reading.
The text was updated successfully, but these errors were encountered:
I took the same example from handlebars.js from their repository and started the project on a Windows 10 PC. The problem is when trying to include the templates it gives me this error:
[plugin:@vituum/vite-plugin-handlebars] The partial templates/Layout/Main.hbs could not be found
Seems to be a windows problem with paths and backslashes.
the problem seems to be from the @vituum/vite-plugin-handlebars package in this line of code:
const partialGlob = !options.partials.directory ? ${options.root}/**/*.hbs : ${resolve(process.cwd(), options.partials.directory)}/**/*.hbs
and the solution seems to normalize the path:
const partialGlob = (!options.partials.directory ? ${options.root}/**/*.hbs : ${resolve(process.cwd(), options.partials.directory)}/**/*.hbs).replace(/\\/g, '/')
const partialName = relative(partialDir, path).replace(/\\/g, '/')
please need to update the package as soon as possible. Thank you for reading.
The text was updated successfully, but these errors were encountered: