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

Inline source map with extended data uri syntax causes an error #25

Closed
asapach opened this issue Jan 26, 2017 · 3 comments
Closed

Inline source map with extended data uri syntax causes an error #25

asapach opened this issue Jan 26, 2017 · 3 comments

Comments

@asapach
Copy link

asapach commented Jan 26, 2017

One of the libraries I'm using has the following inline source map:

//# sourceMappingURL=data:application/json;charset=utf-8;base64,...

This doesn't match the regexp: /data:[^;\n]+;base64,(.*)/, because it specifies an encoding in the mediatype, but it's perfectly valid according to the spec: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs

This results in the wrong code path being taken and the data URI is interpreted as a URL, which results in an error: Cannot find SourceMap 'data:application/json;charset=utf-8;base64,...

I suggest relaxing the regexp to allow semicolon: /data:[^\n]+;base64,(.*)/

@nrdobie
Copy link

nrdobie commented Feb 1, 2017

👍 Having the same issue with PostCSS.

@CNDW
Copy link

CNDW commented Mar 2, 2017

this is fixed by https://github.com/webpack-contrib/source-map-loader/pull/21/files, it's almost 2 months old now, can we get this fixed pushed through?

@michael-ciniawsky
Copy link
Member

Closing since #21 was merge

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

4 participants