expo export: "Chunk containing module not found" for react-native-css components (dual import/require .cjs variants)
Maintainer antworten meist innerhalb von 3 Tagen
@danstepanov arbeitet bereits daran.
Seit 15.7.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Summary
npx expo export (production bundling) fails in Expo's async-chunk serializer with:
AssertionError [ERR_ASSERTION]: Chunk containing module not found:
node_modules/react-native-css/dist/commonjs/components/index.cjs
at .../@expo/metro-config/build/serializer/serializeChunks.js:211:42
at Chunk.getComputedPathsForAsyncDependencies (.../serializeChunks.js:207:19)
at Chunk.serializeToCode (.../serializeChunks.js:266:44)
at Chunk.serializeToAssetsAsync (.../serializeChunks.js:290:29)
...
at exportAppAsync (.../@expo/cli/build/src/export/exportApp.js:193:13)
The Metro dev server (expo start) bundles fine. Only expo export (and therefore production / EAS builds) fails.
Repro
It reproduces with a minimal config, so it is not caused by a custom resolver/transformer:
// metro.config.js
const { getDefaultConfig } = require("expo/metro-config");
const { withNativewind } = require("nativewind/metro");
module.exports = withNativewind(getDefaultConfig(__dirname));
npx expo export --platform android
Full repo (it also covers a separate nativewind issue, but the export failure repros directly):
https://github.com/danstepanov/nw-1824-repro → cd apps/mobile && npx expo export -p android
Likely cause
The ./components subpath exports map points the import and require conditions at two different files that share the same basename:
"./components": {
"source": "./src/components/index.cts",
"import": { "default": "./dist/module/components/index.cjs", ... },
"require": { "default": "./dist/commonjs/components/index.cjs", ... }
}
So the same logical module resolves to two distinct absolute paths depending on the active condition (dist/module/components/index.cjs vs dist/commonjs/components/index.cjs). Expo's getComputedPathsForAsyncDependencies looks up the chunk for the commonjs variant but the chunk was built around the module variant, so the assertion fires. (components/index.cjs itself is a set of lazy require() getters; the only importer in the graph is nativewind/dist/.../test-utils.)
A couple of things worth checking:
- why the ESM (
import) condition points to a.cjsfile underdist/module/, and whether collapsing both conditions to a single canonical path resolves the chunk lookup; - whether
test-utilsshould be reachable from a production graph at all.
Environment
- expo
56.0.12, react-native0.85.3, react19.2.3 - nativewind
5.0.0-preview.4, react-native-css3.0.7(latest stable) - @expo/metro-config
56.0.14 - pnpm
10.8.1monorepo,nodeLinker: hoisted(also note: minimal config, so not resolver-specific)
- Vorherrschende Sprache
- TypeScript
- Sterne
- 166
- Forks
- 45
- Ø Merge
- 13 T. 14 Std.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus nativewind/react-native-css
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
nativewind/react-native-css#545 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
nativewind/react-native-css#544 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
nativewind/react-native-css#543 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
nativewind/react-native-css#540 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
nativewind/react-native-css#538 ·
Maintainer antworten meist innerhalb von 3 Tagen
Alle Issues in nativewind/react-native-css
Ähnliche Issues
-
fix(worker): keep normal prepare waiting states failure-freeEvtl. vergeben @LichKing-2234 hat das heute übernommen. Offenagent:codex priority:P1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
AgoraIO-Extensions/agent-infra#3745 ·
Maintainer antworten meist innerhalb von 1 Tag
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framingEvtl. vergeben @Eapp1e hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
makecindy/cindy#7973 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
lingdojo/kana-dojo#33337 · 1 Kommentar · 5 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
coder/xum#7733 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
code-yeongyu/senpi#4917 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag