Skip to content

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

Closed
@bvaughn

Description

@bvaughn

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions