handlebars-loader
handlebars-loader copied to clipboard
Chrome dev tool console message all points to 'no-conflict.js'
I am using handlebars-loader
with webpack:
when my code cause an error, the dev tool console always show something like this:
note that it said the error code is in no-conflict.js
, and I couldn't add any breakingpoint in my own file, it always jump to the no-conflict.js
my webpack.config.js:
var webpack = require('webpack');
var path = require('path');
module.exports = {
entry: "./js/entry.js",
output: {
path: path.join(__dirname, 'build'),
filename: "bundle.js",
publicPath: './build/'
},
module: {
loaders: [{
test: /\.handlebars$/,
loader: 'handlebars-loader',
query: {
helperDirs: [__dirname + '/js/hbs/helpers']
}
}]
}
};
my entry.js
var html = require('./hbs/a.handlebars')({data: 'this is data'});
var d = document.createElement('div');
d.innerHTML = html;
document.body.appendChild(d);
console.error('my error');
I just couldn't add breakingpoint in my bundle.js
to debug the code.
Same here, any breakpoint I tried to set would instead jump to that no-conflict file. debugger;
fails altogether.
I couldn't figure out what was going on, and considered taking out handlebars :( to keep webpack, until I tried reverting to handlebars 3.x & handlebars-loader 1.1. So far that works, but be wary there's lots in handlebars 4.0.
somebody help???
it makes me remove this loader!!!!
same problem here
+1, what's going on here? edit: I used Firefox's debugger which pointed to the actual error and I was able to resolve this problem. It's still strange that Chrome doesn't pick it up.
not a FireFox fan :disappointed:
since I added a devtool
option to my webpack config, the problem went away.
You can try out those options here: https://webpack.github.io/docs/configuration.html#devtool - I went with #cheap-module-eval-source-map
fwiw
having the same issue on [email protected], and [email protected] all my stack traces get clobbered and point to safe-string.js
Enabled source map in webpack config like this:
{
devtool: "#inline-source-map",
}
Or disable JavaScript source map in Chrome dev tool settings: