React Native "bundling failed" (Metro) in CI
Metro, the React Native bundler, failed while building the JavaScript bundle. The top-level message is generic; the real cause is the resolution or transform error above it.
What this error means
The build fails with error: bundling failed, usually preceded by Unable to resolve module or a Babel transform error naming a file.
error: bundling failed: Error: Unable to resolve module './utils/helpers' from 'src/App.js':
None of these files exist:
* src/utils/helpers(.native|.js|.json)Common causes
Unresolved import or wrong case
A module path is wrong, or the case differs from the file name; case-sensitive CI filesystems fail where macOS did not.
Missing asset or transform error
A referenced asset is absent, or a Babel/transform error breaks the bundle.
How to fix it
Read the resolution error and fix the import
- Find the
Unable to resolve moduleline for the exact path. - Fix the path and match the case to the real file name.
npx react-native bundle --entry-file index.js \
--platform android --dev false \
--bundle-output android/app/src/main/assets/index.android.bundleReset the Metro cache if stale
A stale cache can cause phantom resolution errors; reset it with --reset-cache and rebuild.
How to prevent it
- Match import paths to real file names and case, and commit a clean lockfile. Run the bundle step locally before pushing.