-
Notifications
You must be signed in to change notification settings - Fork 133
Existing sourcemap files in npm packages #167
Comments
WARNING in ./node_modules/@react-keycloak/core/lib/context.js
Module Warning (from ./node_modules/thread-loader/dist/cjs.js):
Failed to parse source map from '{yourProjectPath}/node_modules/@react-keycloak/core/lib/@react-keycloak/core/context.ts' file: Error: ENOENT: no such file or directory, open '{yourProjectPath}/node_modules/@react-keycloak/core/lib/@react-keycloak/core/context.ts'
@ ./node_modules/@react-keycloak/core/lib/index.js 2:0-26 2:0-26
@ ./node_modules/@react-keycloak/web/lib/provider.js 1:0-58 3:35-53
@ ./node_modules/@react-keycloak/web/lib/index.js 1:0-27 1:0-27
@ ./src/App.tsx 8:0-80 60:30-46
@ ./src/index.tsx 7:0-24 11:33-36 |
I use This is a workaround before we resolve the problem. // in webpack config
module.export = {
// ...
ignoreWarnings: [
{
module: /@react-keycloak/,
message: /Failed to parse source map from/,
}
]
} if you use CRA with CRACO. // in .cracorc.js
const ignoreWarnings = options => config => {
if (!config.ignoreWarnings) {
config.ignoreWarnings = [];
}
config.ignoreWarnings.push(...options);
return config;
};
module.export = {
webpack: {
configure: (webpackConfig, { env }) => [
ignoreWarnings([
{
module: /@react-keycloak/,
message: /Failed to parse source map from/,
},
]),
].filter(Boolean).reduce((config, next) => next(config, env) ?? config, webpackConfig),
},
} |
If we're not using CRACO is there a solution? I've not been able to install CRACO in the project due to the new React Scripts. |
+1 I also struggle with this warning |
You can use CRACO in react-scripts v5, but some middleware need you rewrite by yourself. I had upgrade react-scripts v4 to v5 in my project. |
I was able to install craco with |
I submitted a PR to fix this #200 |
Describe the bug
In npm packages, we have
.js.map
files that link to nothing, which can lead to warnings in the webpack.To Reproduce
install npm packages ))
Expected behavior
there are no any
.js.map
files in prodAdditional context
plz extend the build script by using tsconfig for prod, or maybe there is more elegant solution
The text was updated successfully, but these errors were encountered: