Failed to parse source map
Vuliniar opened this issue ยท 6 comments
Hello,
Looks like source map paths are little bit of. It's arguing that it can't parse source maps for following modules:
- @wry/context/src/index.ts
- @wry/context/src/slot.ts
- @wry/equality/src/index.ts
It's arguing that "Failed to parse source map" and "Error: ENOENT: no such file or directory".
This is example of slot.js.map file under @wry/context/lib
I am having this exact same issue
I didn't like the solution to disable generating source maps totally using ENV. Based on similar solutions, I skipped warnings for the time being by adding the following in Craco settings. I guess, similar approach could be used in rewind and similar packages.
webpack: {
configure: (webpackConfig) => {
return {
...webpackConfig,
ignoreWarnings: [
function ignoreWarnings(warning) {
return (
warning.module &&
warning.module.resource.includes("node_modules") &&
warning.details &&
warning.details.includes("source-map-loader")
);
},
],
};
},
},
Same here. I have the same issue due to @apollo/client
.
@Vuliniar @mark-bt @alioguzhan Please try the latest versions of the packages (just published) when you have a chance!
For easy copy/paste:
npm i @wry/equality@latest @wry/context@latest
I strongly suspect the problem was that I needed to remove the src
directory from .npmignore
, so the source files could be published along with the compiled code (in lib
), enabling the relative source paths in the source map. If that's what it was, then #497 should be the fix.
Hi @benjamn ,
I can confirm that the warnings are fixed with the latest releases. Here is what I did to fix it in a CRA app with @apollo/client
installed:
Thanks for the quick fix.
Hi @benjamn
I still have the same issue after adding overrides
as shown above. It seems to be missing maps from @wry/context
and optimism
too. Also tried with yarn resolutions
as shown in the linked issue.
Could not read source map for file:///Volumes/Workspace/japodium-frontend/node_modules/%40wry/trie/lib/es5/index.js: ENOENT: no such file or directory, open '/Volumes/Workspace/japodium-frontend/node_modules/@wry/trie/lib/es5/index.js.map'
Could not read source map for file:///Volumes/Workspace/japodium-frontend/node_modules/%40wry/context/lib/es5/slot.js: ENOENT: no such file or directory, open '/Volumes/Workspace/japodium-frontend/node_modules/@wry/context/lib/es5/slot.js.map'
Could not read source map for file:///Volumes/Workspace/japodium-frontend/node_modules/%40wry/context/lib/es5/index.js: ENOENT: no such file or directory, open '/Volumes/Workspace/japodium-frontend/node_modules/@wry/context/lib/es5/index.js.map'
Could not read source map for file:///Volumes/Workspace/japodium-frontend/node_modules/%40wry/caches/lib/es5/strong.js: ENOENT: no such file or directory, open '/Volumes/Workspace/japodium-frontend/node_modules/@wry/caches/lib/es5/strong.js.map'
Could not read source map for file:///Volumes/Workspace/japodium-frontend/node_modules/%40wry/caches/lib/es5/weak.js: ENOENT: no such file or directory, open '/Volumes/Workspace/japodium-frontend/node_modules/@wry/caches/lib/es5/weak.js.map'
Could not read source map for file:///Volumes/Workspace/japodium-frontend/node_modules/optimism/lib/es5/context.js: ENOENT: no such file or directory, open '/Volumes/Workspace/japodium-frontend/node_modules/optimism/lib/es5/context.js.map'
Could not read source map for file:///Volumes/Workspace/japodium-frontend/node_modules/optimism/lib/es5/helpers.js: ENOENT: no such file or directory, open '/Volumes/Workspace/japodium-frontend/node_modules/optimism/lib/es5/helpers.js.map'
Could not read source map for file:///Volumes/Workspace/japodium-frontend/node_modules/optimism/lib/es5/entry.js: ENOENT: no such file or directory, open '/Volumes/Workspace/japodium-frontend/node_modules/optimism/lib/es5/entry.js.map'
Could not read source map for file:///Volumes/Workspace/japodium-frontend/node_modules/optimism/lib/es5/dep.js: ENOENT: no such file or directory, open '/Volumes/Workspace/japodium-frontend/node_modules/optimism/lib/es5/dep.js.map'
Could not read source map for file:///Volumes/Workspace/japodium-frontend/node_modules/optimism/lib/es5/index.js: ENOENT: no such file or directory, open '/Volumes/Workspace/japodium-frontend/node_modules/optimism/lib/es5/index.js.map'