Skip to content
Latchkey

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.

react-native
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

  1. Find the Unable to resolve module line for the exact path.
  2. Fix the path and match the case to the real file name.
shell
npx react-native bundle --entry-file index.js \
  --platform android --dev false \
  --bundle-output android/app/src/main/assets/index.android.bundle

Reset 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.

Frequently asked questions

What causes ""bundling failed" (Metro)"?
A module path is wrong, or the case differs from the file name; case-sensitive CI filesystems fail where macOS did not.
How do I fix "bundling failed" (Metro)?
Read the resolution error and fix the import

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card