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

[DevTools] Handle sources that contain the string "sourceMappingURL=" #21870

Closed
bvaughn opened this issue Jul 13, 2021 · 0 comments · Fixed by #21871
Closed

[DevTools] Handle sources that contain the string "sourceMappingURL=" #21870

bvaughn opened this issue Jul 13, 2021 · 0 comments · Fixed by #21871

Comments

@bvaughn
Copy link
Contributor

bvaughn commented Jul 13, 2021

It's possible that a source file may contain the string "sourceMappingURL=" in the source (not part of the source map). For example, if we were to parse the source code for parseHookNames, the regex / ?sourceMappingURL=([^\s'"]+)/gm would match itself.

We should have some logic in place for filtering out invalid matches like this. I think the rule should be:

  1. Multiple inline source maps may appear in a file/bundle. Logic exists to parse these and compare the sources field to the parsed error file name. (This case is fine.)
  2. If we're dealing with external source maps though, only look at the last one (at the end of the file).
@bvaughn bvaughn changed the title [DevTools] Handle sources that define the string "sourceMappingURL=" [DevTools] Handle sources that contain the string "sourceMappingURL=" Jul 13, 2021
@bvaughn bvaughn self-assigned this Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant