When the sourceRoot field of a source map is a URL to an absolute windows path, the source files are not correctly loaded.
Example:
{"version":3,"sources":["client/main.t.ts"], "mappings":"...","file":"main.t.js","sourceRoot":"file:///Z:\\project\\library"}
When resolving the sourceRoot, there is a naive replacing of 'file://' with '' instead of calling fileURLToPath which would correctly handle the windows root path. So we end up with the invalid path /Z:\project\library
|
sourcePath = sourcePath.replace(/^webpack:\/\//, '') |
|
const sourceRoot = rawSourceMap.sourcemap.sourceRoot ? rawSourceMap.sourcemap.sourceRoot.replace('file://', '') : '' |
|
const candidatePath = join(sourceRoot, sourcePath) |
When the
sourceRootfield of a source map is a URL to an absolute windows path, the source files are not correctly loaded.Example:
When resolving the sourceRoot, there is a naive replacing of
'file://'with''instead of callingfileURLToPathwhich would correctly handle the windows root path. So we end up with the invalid path/Z:\project\libraryv8-to-istanbul/lib/v8-to-istanbul.js
Lines 117 to 119 in 46b9724