Webpack sourcemap issues

Viewed 1604

I start to learn nodejs and react and trying to build bundle.js and want to dubug it in browser. But I can`t. I created the bundle.map file but the webpack tab dosnt appear in browser. Instead I get errors

DevTools failed to load SourceMap: Could not load content for chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/js/sentry.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load SourceMap: Could not load content for chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/js/commons.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load SourceMap: Could not load content for chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/js/react.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
DevTools failed to load SourceMap: Could not load content for chrome-extension://dipiagiiohfljcicegpgffpbnjmgjcnf/js/content.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

here is webpack.config.js file

var path = require('path');
module.exports = {
    mode: "development",
    entry: "./src/App.js",
    output: {
        path: path.join(__dirname, "dist", "assets"),
        filename: 'bundle.js',
        sourceMapFilename: 'bundle.map'
    },
    devtool: "source-map",
    module: {
        rules: [
            {
            test: /\.js$/,
            exclude: /(node_modules)/,
            use: {
                loader: "babel-loader",
                options: {
                    presets: ["@babel/preset-env", "@babel/preset-react"],
                    sourceMap: true
                }
            }
        }
        ]
    }
}

How can I fix it?

1 Answers

You are passing the sourceMap option to Babel, which probably is not needed and possibly causing the problems.

Related