Webpack Module Warning: Failed to parse source map from "data" URL
Asked Answered
C

11

41

I'm receiving a bummer warning and have been unable to find an available solution:

WARNING in ../lensing/dist/main.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from "data" URL: data:application/json;charset=utf-8;base64,eyJ2ZXJza [...]

My webpack.config.js looks like (setup for npm module):

module.exports = {
    entry: './src/index.js',
    output: {
        filename: 'main.js',
        path: path.resolve(__dirname, 'dist'),
        library: 'lensing',
        libraryTarget: 'umd',
        umdNamedDefine: true
    },
    module: {
        rules: [
            {
                test: /\.m?js$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['@babel/preset-env'],
                        plugins: [
                            '@babel/plugin-proposal-class-properties'
                        ]
                    }
                }
            },
            {
                test: /\.js$/,
                enforce: 'pre',
                use: ['source-map-loader'],
            },
            {
                test: /\.(png|jpg|gif|svg)$/i,
                use: [
                    {
                        loader: 'url-loader',
                        options: {
                            limit: 8192,
                        },
                    },
                ],
            }
        ]
    },
    stats: {
        warningsFilter: [/Failed to parse source map/],
    },
};

I've been surprised not to find much else on this specific issue and am worried that I've missed something that is typically straightforward. I am happy to include any other code snippets that might be helpful but am hoping that the error code might be a strong indiator.

Any advice would be warmly welcomed!

EDIT - more context:

Version: webpack 4.43.0
Time: 6561ms
Built at: 07/31/2020 11:20:55 AM
                               Asset       Size  Chunks             Chunk Names
aafa1b05e4b76ffd04c1fe92edbf15f2.svg  654 bytes          [emitted]  
                             main.js    3.6 MiB    main  [emitted]  main
Entrypoint main = main.js
[0] multi (webpack)-dev-server/client?http://localhost:9000 ./src/index.js 40 bytes {main} [built]
[../lensing/dist/main.js] 2.46 MiB {main} [built] [1 warning]
[./node_modules/openseadragon/build/openseadragon/openseadragon.js] 674 KiB {main} [built]
[./node_modules/webpack-dev-server/client/index.js?http://localhost:9000] (webpack)-dev-server/client?http://localhost:9000 4.29 KiB {main} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.51 KiB {main} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.53 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/createSocketUrl.js] (webpack)-dev-server/client/utils/createSocketUrl.js 2.91 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/log.js] (webpack)-dev-server/client/utils/log.js 964 bytes {main} [built]
[./node_modules/webpack-dev-server/client/utils/reloadApp.js] (webpack)-dev-server/client/utils/reloadApp.js 1.59 KiB {main} [built]
[./node_modules/webpack-dev-server/client/utils/sendMessage.js] (webpack)-dev-server/client/utils/sendMessage.js 402 bytes {main} [built]
[./node_modules/webpack-dev-server/node_modules/strip-ansi/index.js] (webpack)-dev-server/node_modules/strip-ansi/index.js 162 bytes {main} [built]
[./node_modules/webpack/hot sync ^\.\/log$] (webpack)/hot sync nonrecursive ^\.\/log$ 170 bytes {main} [built]
[./src/PIA23533_index32.csv] 622 bytes {main} [built]
[./src/index.css] 519 bytes {main} [built]
[./src/index.js] 1.69 KiB {main} [built]
    + 27 hidden modules

WARNING in ../lensing/dist/main.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from "data" URL: data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvdmlld2ZpbmRlci5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2xlbnNpbmcvLi9zcmMvdmlld2ZpbmRlci5qcz9iNWVmIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIGQzIGZyb20gJ2QzJztcblxuLyoqXG4gKiBAY2xhc3MgVmlld2ZpbmRlclxuICovXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBWaWV3ZmluZGVyIHtcblxuICAgIC8vIENsYXNzIHJlZnNcbiAgICBsZW5zaW5nID0gbnVsbDtcblxuICAgIC8vIERhdGFcbiAgICBkYXRhID0gbnVsbDtcbiAgICBvbiA9IGZhbHNlO1xuXG4gICAgLy8gRWxlbWVudHNcbiAgICBlbHMgPSB7XG4gICAgICAgIGRhdGFQb2ludEc6IG51bGwsXG4gICAgICAgIGc6IG51bGwsXG4gICAgICAgIHJhZGlhbEc6IG51bGwsXG4gICAgICAgIHN2ZzogbnVsbCxcbiAgICAgICAgYm94RzogbnVsbFxuICAgIH07XG5cbiAgICAvLyBDb25maWdzXG4gICAgY29uZmlncyA9IHtcbiAgICAgICAgYm94VzogMTUwLFxuICAgICAgICBib3hIOiA1MCxcbiAgICAgICAgZGVnOiAwLFxuICAgICAgICBleHRlbmQ6IDIwMCxcbiAgICAgICAgZ01hcmdpbjoge3RvcDogMCwgbGVmdDogMCwgcmlnaHQ6IDAsIGJvdHRvbTogMH0sXG4gICAgICAgIGdIOiAwLFxuICAgICAgICBnVzogMCxcbiAgICAgICAgaDogMCxcbiAgICAgICAgcjogMCxcbiAgICAgICAgclBvaW50ZXI6IDAsXG4gICAgICAgIHJQb2ludGVyRXh0OiAyNSxcbiAgICAgICAgdzogMCxcbiAgICB9O1xuXG4gICAgLy8gVG9vbHMgLSBUT0RPIGFkZCBib3hTY2FsZSB0byB0cmFjZSBwZXJpbWV0ZXJcbiAgICB0b29scyA9IHtcbiAgICAgICAgY29vcmRTY2FsZTogZDMuc2NhbGVMaW5lYXIoKVxuICAgICAgICAgICAgLmRvbWFpbihbMCwgMzYwXSlcbiAgICAgICAgICAgIC5yYW5nZShbTWF0aC5QSSwgLU1hdGguUEldKSxcbiAgICAgICAgbGluZU1ha2VyOiBkMy5saW5lKCksXG4gICAgICAgIHhTY2FsZTogZDMuc2NhbGVMaW5lYXIoKSxcbiAgICAgICAgeVNjYWxlOiBkMy5zY2FsZUxpbmVhcigpXG4gICAgfVxuXG4gICAgLypcbiAgICBDb25zdHJ1Y3RvclxuICAgICAqL1xuICAgIGNvbnN0cnVjdG9yKF9sZW5zaW5nKSB7XG4gICAgICAgIC8vIEZpZWxkc1xuICAgICAgICB0aGlzLmxlbnNpbmcgPSB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l9cHhgKVxuICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpXG4gICAgICAgICAgICAuYXR0cignYWxpZ25tZW50LWJhc2VsaW5lJywgJ21pZGRsZScpXG4gICAgICAgICAgICAuc3R5bGUoJ2ZvbnQtZmFtaWx5JywgJ3NhbnMtc2VyaWYnKVxuICAgICAgICAgICAgLnN0eWxlKCdmb250LXNpemUnLCAnMTJweCcpXG4gICAgICAgICAgICAuc3R5bGUoJ2ZvbnQtd2VpZ2h0JywgJ2xpZ2h0ZXInKTtcbiAgICAgICAgdmlzLmVscy5ib3hHLmFwcGVuZCgndGV4dCcpXG4gICAgICAgICAgICAuYXR0cignY2xhc3MnLCAndmlld2ZpbmRlcl9ib3hfdGV4dCB2aWV3ZmluZGVyX2JveF90ZXh0X2InKVxuICAgICAgICAgICAgLmF0dHIoJ2ZpbGwnLCAnd2hpdGUnKVxuICAgICAgICAgICAgLmF0dHIoJ3gnLCBgJHt2aXMuY29uZmlncy5ib3hXIC8gMn1weGApXG4gICAgICAgICAgICAuYXR0cigneScsIGAke01hdGgucm91bmQodmlzLmNvbmZpZ3MuYm94SCAqIDIgLyAzKX1weGApXG4gICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAnbWlkZGxlJylcbiAgICAgICAgICAgIC5hdHRyKCdhbGlnbm1lbnQtYmFzZWxpbmUnLCAnbWlkZGxlJylcbiAgICAgICAgICAgIC5zdHlsZSgnZm9udC1mYW1pbHknLCAnc2Fucy1zZXJpZicpXG4gICAgICAgICAgICAuc3R5bGUoJ2ZvbnQtc2l6ZScsICcxMXB4JylcbiAgICAgICAgICAgIC5zdHlsZSgnZm9udC1zdHlsZScsICdpdGFsaWMnKVxuICAgICAgICAgICAgLnN0eWxlKCdmb250LXdlaWdodCcsICdsaWdodGVyJyk7XG5cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBAZnVuY3Rpb24gd3JhbmdsZVxuICAgICAqXG4gICAgICovXG4gICA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5jb25maWdzLmV4dGVuZH1weDtgKVxuXG4gICAgICAgICAgICAvLyBVcGRhdGUgcmFkaWFsR1xuICAgICAgICAgICAgdmlzLmVscy5yYWRpYWxHLnN0eWxlKCd0cmFuc2Zvcm0nLCBgdHJhbnNsYXRlKCR7dmlzLmNvbmZpZ3MuZ1cgLyAyfXB4LCAke3Zpcy5jb25maWdzLmdIIC8gMn1weClgKVxuXG4gICAgICAgICAgICAvLyBVcGRhdGUgZGF0YVBvaW50R1xuICAgICAgICAgICAgdmlzLmVscy5kYXRhUG9pbnRHXG4gICAgICAgICAgICAgICAgLmRhdHVtKHZpcy5kYXRhKVxuICAgICAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uIChkKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGcgPSBkMy5zZWxlY3QodGhpcyk7XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gUG9pbnRlciBjb29yZHNcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcENvb3JkcyA9IGdldENvb3Jkcyh2aXMuY29uZmlncy5yUG9pbnRlciwgdmlzLmRlZyAtIDkwKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgYWRkWCA9IE1hdGgucm91bmQodmlzLnRvb2xzLnhTY2FsZShwQ29vcmRzWzBdKSk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGFkZFkgPSBNYXRoLnJvdW5kKHZpcy50b29scy55U2NhbGUocENvb3Jkc1sxXSkpO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSBwYXRoXG4gICAgICAgICAgICAgICAgICAgIGcuc2VsZWN0KCdwYXRoJylcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgdmlzLnRvb2xzLmxpbmVNYWtlcihbWzAsIDBdLCBwQ29vcmRzXSkpO1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSBib3hHIHZpc2liaWxpdHksIHBvc1xuICAgICAgICAgICAgICAgICAgICB2aXMuZWxzLmJveEcuc3R5bGUoJ3Zpc2liaWxpdHknLCAndmlzaWJsZScpO1xuICAgICAgICAgICAgICAgICAgICB2aXMuZWxzLmJveEcuc3R5bGUoJ3RyYW5zZm9ybScsIGB0cmFuc2xhdGUoJHtwQ29vcmRzWzBdICsgYWRkWH1weCwgJHtwQ29vcmRzWzFdICsgYWRkWX1weClgKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgLyogZ2V0Q29vcmRzICovXG4gICAgICAgICAgICBmdW5jdGlvbiBnZXRDb29yZHMociwgaSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHggPSBNYXRoLnJvdW5kKHIgKiBNYXRoLnNpbih2aXMudG9vbHMuY29vcmRTY2FsZShpKSkpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHkgPSBNYXRoLnJvdW5kKHIgKiBNYXRoLmNvcyh2aXMudG9vbHMuY29vcmRTY2FsZShpKSkpO1xuICAgICAgICAgICAgICAgIHJldHVybiBbeCwgeV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG5cbiAgICAgICAgICAgIC8vIEhpZGVcbiAgICAgICAgICAgIHZpcy5lbHMuYm94Ry5zdHlsZSgndmlzaWJpbGl0eScsICdoaWRkZW4nKTtcbiAgICAgICAgfVxuXG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQGZ1bmN0aW9uIHVwZGF0ZV9ib3hfdGV4dFxuICAgICAqIFVwZGF0ZXMgdGhlIHRleHQgZnJvbSBkYXRhXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gZFxuICAgICAqXG4gICAgICovXG4gICAgdXBkYXRlX2JveF90ZXN0KGQpIHtcbiAgICAgICAgLy8gRGVmaW5lIHRoaXNcbiAgICAgICAgY29uc3QgdmlzID0gdGhpcztcblxuICAgICAgICAvLyBVcGRhdGVcbiAgICAgICAgdmlzLmVscy5ib3hHLnNlbGVjdCgnLnZpZXdmaW5kZXJfYm94X3R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BQUNBO0FBQ0E7QUFDQTtBQWxDQTtBQUNBO0FBQ0E7QUFJQTtBQUNBO0FBRUE7QUFHQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBR0E7QUFDQTtBQUNBO0FBUUE7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUVBOzs7Ozs7Ozs7O0FBT0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBRUE7Ozs7OzsiLCJzb3VyY2VSb290IjoiIn0=\n//#
 @ ./src/index.js 3:0-29 65:19-30
Communicable answered 31/7, 2020 at 16:38 Comment(6)
when does this error happen? browser or on build?Plaster
Thanks @henokg - seeing it in both places (w webpack dev server and in Chrome console). Any thoughts? EDIT - more specifically it is linked (w npm link) to a demo using webpack (so I am seeing the error in the demo).Communicable
can you post more of the error? can't seem to make anything of this alone and can you post it from the dev server console and not the browser one\Plaster
Thanks - I've just done. As a sort of fix I removed the source-map-parser and the warning disappeared. Is it possible this issue happened because a webpack watch package was linked to a webpack watch application?Communicable
good thing it worked, i thought the issue was related to performance or size limitationPlaster
Thanks @henokg for willingness to help - be blessed!Communicable
K
42

If you're experiencing this issue with react-scripts/cra version 5.0.0. You'll need to add the following to your .env file

NOTE: this is not a fix. You are suppressing the source map warnings, but it may get you from seeing those warnings since all other solutions have not worked.

GENERATE_SOURCEMAP=false

or you can update your script to

"start": "GENERATE_SOURCEMAP=false react-scripts start",

Note: this is a temporary patch until 5.0.1 is released. See create-react-app repo pull request Update: 5.0.1 was release on April 2022. Changelog. The update did not fix this issue. Not sure when that will be 🤷🏾‍♂️

Kunlun answered 3/2, 2022 at 17:40 Comment(2)
uhm source maps have a purpose and not generating them will break many development flowsPictish
Well aware of it but instead of getting 200+ warnings I can't fix at this moment this is a fair alternate patch until 5.0.1 gets releaseKunlun
S
32

A better way. The following keeps source maps, and just removes the spam warning. From the docs

module.exports = {
  module: {
    rules: [
      {
        test: /\.js$/,
        enforce: "pre",
        use: ["source-map-loader"],
      },
    ],
  },
  ignoreWarnings: [/Failed to parse source map/],
};
Saucedo answered 24/6, 2021 at 15:45 Comment(0)
E
13

I have the same problem.

This isn't a solution, but a better workaround than the other "answer":

change your webpack.config.js module.rules setting for source-map-loader to this:

//module.rules:[
            {
                    test: /\.js$/,
                    enforce: 'pre',
                    use: [
                        {
                            //needed to chain sourcemaps.  see: https://webpack.js.org/loaders/source-map-loader/
                            loader: 'source-map-loader',
                            options: {

                                filterSourceMappingUrl: (url, resourcePath) => {
                                    //  console.log({ url, resourcePath }) example:
                                    // {
                                    //  url: 'index.js.map',
                                    //  resourcePath: '/repos/xlib-wsl/common/temp/node_modules/.pnpm/[email protected]/node_modules/https-proxy-agent/dist/index.js'
                                    // }

                                    if (/.*\/node_modules\/.*/.test(resourcePath)) {
                                        return false
                                    }
                                    return true
                                }

                            }
                        }],
                },

That is, don't load sourcemaps for your node_module dependencies.

Ernst answered 23/9, 2020 at 19:59 Comment(2)
Why is it better than using the exclude property? Seems to do the same through more complex JS code.Atworth
The selected answer clearly stated, "if you are using react-scripts/cra" which implies you cannot access the webpack config.Mcconnell
C
11
{
    test: [/\.js?$/, /\.ts?$/, /\.jsx?$/, /\.tsx?$/],
    enforce: 'pre',
    exclude: /node_modules/,
    use: ['source-map-loader'],
},

include this into config file and download the source-map-loader as a dev-dependency

Coveney answered 14/5, 2021 at 20:53 Comment(1)
Excluding node_modules from source maps is indeed a workaround (if you're not interested in debugging down to the libs), but source-map-loader can only handle js files.Atworth
B
8

Adding to the solutions above, when using create-react-app having added react-app-rewired and customize-cra you can also get rid of the source map warnings updating config-overrides.js and setting ignoreWarnings

const { override } = require("customize-cra");

const ignoreWarnings = value => config => {
  config.ignoreWarnings = value;
  return config;
};

module.exports = override(
  ignoreWarnings([/Failed to parse source map/])
);
Buggery answered 16/1, 2022 at 2:59 Comment(0)
J
8

Extending FrozenKiwi's answer for Craco

// craco.config.js
module.exports = {
    reactScriptsVersion: "react-scripts" /* (default value) */,
    webpack: {
        mode: 'extends',
        configure: {
            module: {
                rules: [
                    {
                        test: /\.js$/,
                        enforce: "pre",
                        use: ["source-map-loader"],
                    },
                ],
            },
            ignoreWarnings: [/Failed to parse source map/],
        },
    },
}
Jamila answered 8/7, 2022 at 11:57 Comment(1)
Thanks for this! This works and also seems to speed up the rebuildingAbbreviation
E
1

The best solution is to create a 'config-overrides.js' file on your root directory.the add below code:

const webpack = require('webpack');

module.exports = function override(config) {

    config.ignoreWarnings = [/Failed to parse source map/];
    const fallback = config.resolve.fallback || {};
    Object.assign(fallback, {
        "crypto": require.resolve("crypto-browserify"),
        "stream": require.resolve("stream-browserify"),
        "assert": require.resolve("assert"),
        "http": require.resolve("stream-http"),
        "https": require.resolve("https-browserify"),
        "os": require.resolve("os-browserify"),
        "url": require.resolve("url")
    })

    config.resolve.fallback = fallback;
    config.plugins = (config.plugins || []).concat([
        new webpack.ProvidePlugin({
            process: 'process/browser',
            Buffer: ['buffer', 'Buffer']
        })
    ])
    return config;
}

after that install dev npm packages for webpack

npm i -D crypto-browserify stream-browserify assert stream-http https-browserify os-browserify url

and finally you need to change your package.json start and build

 "scripts": {
    "start": "react-app-rewired start",
    "build": "react-app-rewired build",
  },
Exhibitionist answered 24/5, 2023 at 9:33 Comment(0)
C
0

Why the warning?

I was running webpack on an npm package in watch mode and testing it on a demo app that was also using webpack in watch mode by using npm link [package-name].

Workaround for dev:

Remove source-map-loader from the webpack.config.js in your demo.

Communicable answered 31/7, 2020 at 18:48 Comment(0)
P
0

I was having the same warning in the console when working on a project created with create-react-app and the following solution worked for me.

I replaced the @remix-run folder in node_modules with the same folder from a different CRA project which was running without this warning and the warning disappeared.

Pemphigus answered 3/2, 2023 at 1:26 Comment(0)
C
-1

faced same issue, i think your api is not being called becuase of cors issue

Consecrate answered 16/11, 2022 at 20:46 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Kremenchug
T
-3

This solution helps me in create-react-app.

You can add this fix by editing the file node_modules/react-scripts/config/webpack.config.js, and pasting this after the line performance: false,

ignoreWarnings: [
  // Ignore warnings raised by source-map-loader.
  // some third party packages may ship miss-configured sourcemaps, that interrupts the build
  // See: https://github.com/facebook/create-react-app/discussions/11278#discussioncomment-1780169
  /**
   *
   * @param {import('webpack').WebpackError} warning
   * @returns {boolean}
   */
  function ignoreSourcemapsloaderWarnings(warning) {
    return (
      warning.module &&
      warning.module.resource.includes('node_modules') &&
      warning.details &&
      warning.details.includes('source-map-loader')
    );
  },
],

But when you make yarn install or npm install, yours edits will be deleted.

Thury answered 30/6, 2022 at 7:49 Comment(3)
Its bad practice to edit anything in node_modulesRus
@Matt Nienow I know it, but at now l don't know better solution in create-react-app. If you know better solution - write please! In my incident it happens after add antd 4.21Thury
@Thury you can use either craco or customize-cra.Thursby

© 2022 - 2024 — McMap. All rights reserved.