Open Bug 1702920 Opened 4 years ago Updated 3 years ago

Source maps with scheme-less paths containing colons ignore the sourceRoot property

Categories

(DevTools :: Debugger, defect, P3)

Firefox 88
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: yaurthek, Unassigned, NeedInfo)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0

Steps to reproduce:

On Windows, I have a source map file like this:
{..., "sources":["C:/src/App.fs"], "sourceRoot":"http://localhost/sourceMaps/", ...}

I expect the source map final url to be http://localhost/sourceMaps/C:/src/App.fs and with Chrome it is, but with Firefox it's not the case, and fetching the source map fails:

Error while fetching an original source: NetworkError when attempting to fetch resource.
Source URL: c:/src/App.fs

It seems that C:/ is interpreted as a scheme/protocol, so the sourceRoot is ignored, and the final url is C:/src/App.fs which cannot work.

If I escape the path (C%3A/src/App.fs), the final url is as expected: http://localhost/test/C%3A/src/App.fs


Side note: my end goal is to be able to set sourceRoot to "file:///" and be able to use source maps without hosting them. It works out of the box with Chrome, and it works after escaping the colon to %3A with Firefox, but this is annoying as I have to post-process all my source maps...

Flags: needinfo?(hmanilla)
Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.