DevTools failed to load SourceMap for webpack:///node_modules//…js.map HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME

前端 未结 5 1284
情话喂你
情话喂你 2021-02-12 10:20

I created a simple webpack based project to learn snabbdom. Everything was OK except that sourcemap failed loading:

I don\'t know whose issue(webpack, chrome) i

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-12 10:55

    Update webpack.config.js

    module.exports = {
        // ...
        entry: {
          "app": "src/app.js"
        },
        output: {
          path: path.join(__dirname, 'dist'),
          filename: "[name].js",
          sourceMapFilename: "[name].js.map"
        },
        devtool: "source-map"
        // ...
    };
    

    Detailed in https://blog.sentry.io/2018/10/18/4-reasons-why-your-source-maps-are-broken

提交回复
热议问题