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 ENOENT when sources is not a valid file path #134

Closed
hedgepigdaniel opened this issue Dec 2, 2020 · 2 comments

Comments

@hedgepigdaniel
Copy link

  • webpack Version: 4
  • source-map-loader Version: 1.1.2

Expected Behavior

Source maps should be parsed correctly and mappings should be included for all files that have sourcesContent or for which sources points to a valid file (even if there are some sources for which the values are invalid/missing).

Actual Behavior

source maps generated with the Google Closure compiler are not parsed at all.

This is because they contain some sources which are not present on the filesystem, and/or "sources" like " [synthetic:es6/util/arrayiterator] ". See google/closure-compiler-js#25

Failed to parse source map from 'node_modules/shaka-player/node_modules/google-closure-library/closure/goog/base.js' file: Error: ENOENT: no such file or directory, open 'node_modules/shaka-player/node_modules/google-closure-library/closure/goog/base.js'
Failed to parse source map from 'node_modules/shaka-player/dist/ [synthetic:util/global] ' file: Error: ENOENT: no such file or directory, open 'node_modules/shaka-player/dist/ [synthetic:util/global] '

Obviously the mappings referring to these source files will not work because they are not present, but the other mappings for files that are present should still work.

How Do We Reproduce?

Applying source-map-loader to the latest build of https://github.com/google/shaka-player triggers the error.

@alexander-akait
Copy link
Member

even if there are some sources for which the values are invalid/missing

No, source maps will be broken in this case, even we provide options to filter you still have invalid mapping, library source maps should not contain this stuff

@hedgepigdaniel
Copy link
Author

Sorry I made a mistake - I though that the entire source map wasn't working, but in fact its only the invalid sources that don't work. No problem :)

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

No branches or pull requests

2 participants