Replies: 33 comments 32 replies
-
To ignore the warning you can disable sourcemap generation via setting env var But I'm also curios if this should be ignored or fixed somehow |
Beta Was this translation helpful? Give feedback.
-
you can just ignore them, it would not make CI failed when builds. |
Beta Was this translation helpful? Give feedback.
-
I got the same problem from upgrading CRA 3.4.3 to 5.0.0. |
Beta Was this translation helpful? Give feedback.
-
Is there a proper fix or just ignore? |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. Is there a way to get around this? |
Beta Was this translation helpful? Give feedback.
-
There's a PR open #11752. There's no estimated time for the 5.0.1 release so, until that just ignore. |
Beta Was this translation helpful? Give feedback.
-
The best solution is to open a issue or pullrequest on that packages. The warnings are correct. These packages source maps pointing to src that is not included in the package. The solution would be to remove source maps from the package or add the src at the location the source maps pointing to. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem, and why its happened? |
Beta Was this translation helpful? Give feedback.
-
a simple solution:
More on the link below: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Does anyone fix it ? |
Beta Was this translation helpful? Give feedback.
-
I also want to know how to fix this. |
Beta Was this translation helpful? Give feedback.
-
Some enlightenment. This happens to me when using a personal-component-library. Look at this warning message:
In my package there is three files for "ArrayHelper" in the dist folder. ArrayHelper.js.map generated from the original file src/utils/ArrayHelper.ts But for some reason CRA wants the .ts file too. ................................. ( Source Code ) Just for details, here are the source code for all files. ArrayHelper.ts
in the dist folder. ArrayHelper.d.ts
ArrayHelper.js
ArrayHelper.js-map
.................................................... Umm, looking at my own example. I decided to remove sourcemaps from rollup. And that make the issue in CRA go away too. rollup.config.js
|
Beta Was this translation helpful? Give feedback.
-
Some enlightenment. This happens to me when using a personal-component-library. Look at this warning message:
In my package there is three files for "ArrayHelper" in the dist folder. ArrayHelper.js.map generated from the original file src/utils/ArrayHelper.ts But for some reason CRA wants the .ts file too. |
Beta Was this translation helpful? Give feedback.
-
If you're like me and using the craco ( module.exports = {
webpack: {
configure: {
ignoreWarnings: [
function ignoreSourcemapsloaderWarnings(warning) {
return (
warning.module &&
warning.module.resource.includes("node_modules") &&
warning.details &&
warning.details.includes("source-map-loader")
);
},
],
},
},
}; |
Beta Was this translation helpful? Give feedback.
-
Getting the same issue for
|
Beta Was this translation helpful? Give feedback.
-
You can use temporary solution at https://stackoverflow.com/questions/36051891/esri-failed-to-parse-source-map/70975790#70975790 . Add
|
Beta Was this translation helpful? Give feedback.
-
Lots of folks here seem to be suggesting setting If some package in There ought to be some way to say "If you can't find the sourceMap, and you were looking in |
Beta Was this translation helpful? Give feedback.
-
For anyone else using
As @ipmcc stated, I think |
Beta Was this translation helpful? Give feedback.
-
Just keep the source folder with the dist/ lib this will solve the issue |
Beta Was this translation helpful? Give feedback.
-
@MarcStdt @otariterterashvili @ipmcc I have an ugly solution but it allows you to keep your existing source maps and suppress these warnings without using react-app-rewired, cracko or You can create a script like so: const { readFileSync, writeFileSync } = require("fs");
const path = "node_modules/source-map-loader/dist/utils.js";
const regex = /.*throw new Error\(`Failed to parse source map from '\${sourceURL}' file: \${error}`\);*/;
const text = readFileSync(path, "utf-8");
const newText = text.replace(regex, `buffer="";sourceURL="";`);
writeFileSync(path, newText, "utf-8"); and then add it to your "scripts": {
"start": "node scripts/removeSourceMapsWarning.js && react-scripts start" Obviously this code will stop working when |
Beta Was this translation helpful? Give feedback.
-
I recommend that CRA maintainers add an "ignoreWarnings" entry to webpack.config.js as described in the source-map-loader README.md:
Maybe it could be added if some new env variable is set or not set. For now, you can take the @figuratively script and turn it into a postinstall script that modifies webpack.config.js as part of the installation:
|
Beta Was this translation helpful? Give feedback.
-
This discussion has been open for a year and has 94 votes (which seems to be the most votes), yet the author chooses to ignore it. |
Beta Was this translation helpful? Give feedback.
-
Simply installing your own copy of source-map-loader to the project seems to solve this: |
Beta Was this translation helpful? Give feedback.
-
@xml, is their any disadvantage for installing the own copy of source-map-loader to the project? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
use "vite" and solve the underlying problem |
Beta Was this translation helpful? Give feedback.
-
in my case it fixed by adding GENERATE_SOURCEMAP=false in .env file |
Beta Was this translation helpful? Give feedback.
-
Any progress on this? |
Beta Was this translation helpful? Give feedback.
-
Same issue is here while using intro.js and intro.js-react library in my react typescrit project. I did some changes in my webpack-rtl.config.js file but nothing happened. |
Beta Was this translation helpful? Give feedback.
-
Upgraded and now I'm getting a lot of Failed to parse source map from warnings. How can I resolve or just ignore these ?
Beta Was this translation helpful? Give feedback.
All reactions