Unverified Commit dec0ebe6 authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

Webpack: handle file:// urls when finding sourcemaps (#76443)

Previously we only handled the eval sourcemaps case where the module id
was encoded into the source url. This handles cases when the `file://`
protocol is used, such as with Rspack.
    
Test Plan: `pnpm test-dev-rspack
test/development/acceptance-app/rsc-runtime-errors.test.ts`
parent 121306dd
......@@ -287,6 +287,9 @@ async function getSource(
): Promise<Source | undefined> {
const { getCompilations } = options
// Rspack is now using file:// URLs for source maps. Remove the rsc prefix to produce the file:/// url.
sourceURL = sourceURL.replace(/(.*)\/(?=file:\/\/)/, '')
let nativeSourceMap: SourceMap | undefined
try {
nativeSourceMap = findSourceMap(sourceURL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment