Skip to content
OBLAIDISH NEWS
Next.js source map provenance break identified in field test
TX_761698Engineering

Next.js source map provenance break identified in field test

Scarab Systems’ field test #012 shows that production browser source maps lose original client content during Turbopack composition when the React Compiler is enabled, and proposes a narrow fix.

Scarab Systems released field test #012 showing that production browser source maps in Next.js lose original source content during Turbopack composition when the React Compiler is enabled [Dev.to][GitHub Issue].

── What shipped ──

The test targets issue #94450 in the Next.js repository. A production build that uses the React Compiler and Turbopack emits a final source map whose sourcesContent contains the transformed compiler output instead of the original client file. The diagnostic boundary traced the loss to the step that merges the Babel‑generated map with Turbopack’s own map before emitting the browser chunk. Scarab demonstrated two repair actions: (1) preserve the loader’s original input source in the Babel loader’s map, and (2) fill missing provenance fields so Turbopack can match the intermediate map back to its origin file. Both changes were verified locally with a regression fixture that asserts the final browser map still contains the untouched client source marker.

── Why it matters ──

Source maps serve as provenance artifacts; when sourcesContent diverges from the true source, developers cannot trace runtime errors back to the exact code they wrote, forcing costly manual inspection. The drift occurs at the composition step, not during the initial React Compiler transform, allowing a targeted fix without overhauling the entire source‑map pipeline. A narrow patch to the provenance boundary can be shipped as a small Turbopack utility update, reducing risk for Vercel and downstream projects.

operator_channel
[ comments_offline · provider_not_configured ]
transmission_log

Subscribe to the broadcast.

Daily digest of the day's most important tech news. No fluff. Engineering signal only.

// delivered via substack · double-opt-in confirmation