handlebars-loader icon indicating copy to clipboard operation
handlebars-loader copied to clipboard

Chrome dev tool console message all points to 'no-conflict.js'

Open littlee opened this issue 9 years ago • 9 comments

I am using handlebars-loader with webpack: when my code cause an error, the dev tool console always show something like this: qq 20151119161021

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 qwqwq

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.

littlee avatar Nov 19 '15 08:11 littlee

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.

kdoran avatar Nov 22 '15 15:11 kdoran

somebody help???

littlee avatar Nov 26 '15 13:11 littlee

it makes me remove this loader!!!!

jumplee avatar Dec 09 '15 07:12 jumplee

same problem here

tmaximini avatar Jan 12 '16 15:01 tmaximini

+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.

TristanWright avatar Jan 12 '16 17:01 TristanWright

not a FireFox fan :disappointed:

littlee avatar Jan 13 '16 01:01 littlee

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

tmaximini avatar Jan 14 '16 07:01 tmaximini

having the same issue on [email protected], and [email protected] all my stack traces get clobbered and point to safe-string.js

davis avatar Mar 11 '16 03:03 davis

Enabled source map in webpack config like this:

{
    devtool: "#inline-source-map",
}

Or disable JavaScript source map in Chrome dev tool settings: 2016-05-06_1242

lleelleeoo avatar May 06 '16 09:05 lleelleeoo