Bug
The ReactFlightWebpackPlugin (vendored from react-server-dom-webpack) silently drops chunks from the client manifest (react-client-manifest.json) when a chunk contains both .css and .js files and the .css file is iterated first in the chunk's files Set.
Root Cause
In the processAssets hook, the plugin iterates c.files using a for...of loop inside a forEach callback:
chunkGroup.chunks.forEach(function (c) {
for (const file of c.files) {
if (!file.endsWith('.js')) break; // ← BUG: exits entire loop
if (file.endsWith('.hot-update.js')) break;
chunks.push(c.id, file);
break;
}
});
The first break (compiled from return in the React source) is intended to skip non-JS files and try the next file. But break exits the for loop entirely (and return in the source exits the forEach callback), so when a .css file appears before the .js file in the Set iteration order, the .js file is never examined. The chunk is completely omitted from the manifest.
Impact
- The client manifest's
chunks array is empty for affected modules
- The RSC Flight runtime can't locate client components → RSC fails silently or errors at hydration
- The bug is non-deterministic: it depends on
Set insertion order, which varies across webpack versions and environments
- Triggered by
mini-css-extract-plugin or any loader that produces .css chunk files alongside .js
Fix
Change break to continue (compiled) / return to continue (source) for the two skip conditions:
// Fixed:
for (const file of c.files) {
if (!file.endsWith('.js')) continue; // skip non-JS, try next file
if (file.endsWith('.hot-update.js')) continue; // skip HMR, try next file
chunks.push(c.id, file);
break; // found JS file, done
}
Fix Commit
The fix has been applied to the React fork:
AbanoubGhadban/react@8b6dec4
Branch: fix/flight-plugin-css-chunk-skip (based on rsc-patches/v19.0.3)
Upstream
This is an upstream bug in facebook/react, introduced in commit 701ac2e5 (PR #27314, Sep 2023) and still unfixed on main as of March 2026. Next.js is unaffected because they wrote their own plugin using nested forEach (where return naturally acts as continue).
Bug
The
ReactFlightWebpackPlugin(vendored fromreact-server-dom-webpack) silently drops chunks from the client manifest (react-client-manifest.json) when a chunk contains both.cssand.jsfiles and the.cssfile is iterated first in the chunk'sfilesSet.Root Cause
In the
processAssetshook, the plugin iteratesc.filesusing afor...ofloop inside aforEachcallback:The first
break(compiled fromreturnin the React source) is intended to skip non-JS files and try the next file. Butbreakexits theforloop entirely (andreturnin the source exits theforEachcallback), so when a.cssfile appears before the.jsfile in the Set iteration order, the.jsfile is never examined. The chunk is completely omitted from the manifest.Impact
chunksarray is empty for affected modulesSetinsertion order, which varies across webpack versions and environmentsmini-css-extract-pluginor any loader that produces.csschunk files alongside.jsFix
Change
breaktocontinue(compiled) /returntocontinue(source) for the two skip conditions:Fix Commit
The fix has been applied to the React fork:
AbanoubGhadban/react@8b6dec4
Branch:
fix/flight-plugin-css-chunk-skip(based onrsc-patches/v19.0.3)Upstream
This is an upstream bug in
facebook/react, introduced in commit701ac2e5(PR #27314, Sep 2023) and still unfixed onmainas of March 2026. Next.js is unaffected because they wrote their own plugin using nestedforEach(wherereturnnaturally acts ascontinue).