Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to parse source map #492

Closed
Vuliniar opened this issue May 9, 2023 · 6 comments · Fixed by #497
Closed

Failed to parse source map #492

Vuliniar opened this issue May 9, 2023 · 6 comments · Fixed by #497
Assignees

Comments

@Vuliniar
Copy link

Vuliniar commented May 9, 2023

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

Screenshot 2023-05-09 at 11 21 28

@mark-bt
Copy link

mark-bt commented May 9, 2023

I am having this exact same issue

@Vuliniar
Copy link
Author

Vuliniar commented May 9, 2023

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")
            );
          },
        ],
      };
    },
  },

@alioguzhan
Copy link

Same here. I have the same issue due to @apollo/client.

@benjamn
Copy link
Owner

benjamn commented May 15, 2023

@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.

@alioguzhan
Copy link

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:

image

Thanks for the quick fix.

@ansmlc
Copy link

ansmlc commented Apr 25, 2024

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants