expo export: "Chunk containing module not found" for react-native-css components (dual import/require .cjs variants)
メンテナーはふだん 3 日以内に返信
@danstepanov がすでに取り組んでいます。
2026年7月15日 から。
評価
この issue はまだ評価されていません。
説明
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)
- 主要言語
- TypeScript
- スター
- 166
- フォーク
- 45
- 平均マージ
- 13日 14時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nativewind/react-native-css のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nativewind/react-native-css#545 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nativewind/react-native-css#544 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nativewind/react-native-css#543 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nativewind/react-native-css#540 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nativewind/react-native-css#538 ·
メンテナーはふだん 3 日以内に返信
nativewind/react-native-css の issue をすべて見る
似ている issue
-
fix(worker): keep normal prepare waiting states failure-free対応中かも @LichKing-2234 が今日担当しました。 オープンagent:codex priority:P1
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AgoraIO-Extensions/agent-infra#3745 ·
メンテナーはふだん 1 日以内に返信
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framing対応中かも @Eapp1e が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
makecindy/cindy#7973 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
lingdojo/kana-dojo#33337 · コメント 1 件 · リアクション 5 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
code-yeongyu/senpi#4917 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信