Closed ethikz closed 5 years ago
hello, have you solved this I'm getting the same error. Thanks in advance!
@selenearzola No sorry, I have not resolved this problem. I dug a little bit without finding anything. I have since moved away from Handlebars.
I solved yesterday, this is my solution on webpack.config.js:
const path = require('path');
module.exports = {
mode: 'development',
entry: path.resolve(__dirname, 'www/js/app.js'),
output: {
filename: 'app-bundled.js',
path: path.resolve(__dirname, 'www/js')
},
module: {
rules: [
{
test: /\.hbs$/,
use: [{
loader: "handlebars-loader",
options: {
helperDirs: path.resolve(__dirname, "./www/js/helpers"),
partialDirs: path.resolve(__dirname, "./www/js/partials")
}
}]
}
]
}
};
@selenearzola Hi , do you use extend in your handlebars. I get the similar error now ERROR in Template execution failed: Error: Missing helper: "extend"
I'm not sure but I believe that this extend helper is one of the required helpers of handlebars so there is a way that I cannot remember right now to install it and once you do it should work.
The extend
helper mentioned in the original post is from handlebars-layouts
, not this library. This library does have an extend
helper but it does something different.
I'm going to close this issue since it's related to a different library.
I'm using webpack with
handlebars-loader
. I've specified my helpers and partials directory but when I try to compile I am given an error.My webpack.config is setup like:
And in my
index.hbs
I haveWhen I remove the
extend
it renders fine, well it doesn't throw a compile error. I've read where others are actually using js and creating the hbs template inside of js file where entry point is but I am looking to utilizehbs
files to be able to keep it separated.I've also used
handlebars-webpack-plugin
to help with this but that's for server side rendering. But it doesn't solve my issue of precompilation of the hbs templates and the helpersMy webpack.config
Am I missing something or is there an issue with
Webpack
andhandlebars-helpers
? Any help would be appreciated.