React Native 0.72 shipped a Metro release that finally makes two long-requested resolver features usable in normal projects: stable support for symlinks (the thing monorepos and npm/yarn link workflows depend on) and opt-in support for the Node-style exports field in package.json. In practice this means fewer "Unable to resolve module" errors in workspaces, and libraries that only declare their entry points through exports now resolve instead of silently falling back to main. The catch is that symlink support has to be turned on deliberately in metro.config.js, and package exports are still behind a flag, so most "it changed everything" surprises come from config that was written for older Metro.

The overall task is small: enable unstable_enableSymlinks, decide whether to enable unstable_enablePackageExports, then make sure your watched folders and custom resolvers still agree with the new behaviour.

What You'll Need

  • A project running React Native 0.72, or one you are upgrading to it, with the Metro version that ships alongside it (do not mix in an older metro-config manually).
  • Node.js installed and your package manager working (npm, yarn or pnpm).
  • A terminal open at the project root, plus an editor for metro.config.js.
  • If you use a monorepo, the paths to your workspace packages and to the shared node_modules folder.
  • A working npx react-native start --reset-cache command, so you can reproduce issues from a clean cache.

Step-by-Step

  1. Confirm which Metro you are running. Check the metro and metro-config versions in your lockfile or with npm ls metro. React Native 0.72 pins a matching Metro; if your lockfile shows an older Metro hoisted from a dependency, fix that first by reinstalling, because the symlink and exports behaviour simply is not present in older versions.

  2. Open (or create) metro.config.js. React Native projects normally have this file at the root. If it is missing, generate one from the default template by running npx react-native bundle --help to confirm the CLI is working, then create the file yourself and export a configuration object. Keep it a plain module.exports = { ... } unless you already use the mergeConfig helper from @react-native/metro-config.

  3. Enable symlinks. Add unstable_enableSymlinks: true to the top level of the config object (not inside resolver). Despite the unstable prefix used at the time of the release, this is the switch that tells Metro to follow symlinked folders and to key its cache on file identity rather than absolute path. Without it, a package linked into node_modules is not descended into, which is why imports from a linked workspace package fail.

  4. Add any extra watch folders. Metro only crawls the project root by default. In a monorepo, set watchFolders to the absolute paths of the sibling packages (and, if your manager hoists, the root node_modules). Use path.resolve(__dirname, '../packages') style paths so the config stays portable between machines.

  5. Decide on package exports. Add unstable_enablePackageExports: true inside the resolver block if your dependencies rely on the exports map. When enabled, Metro reads the "exports" field of a package and, where a "react-native" condition is declared, prefers it over main. Leave it off if some dependency has a broken or overly strict exports map, because a bad map can block subpath imports that used to work.

  6. If you are on the New Architecture or use the react-native condition, set the condition list. resolver.unstable_conditionNames takes an array such as ['require', 'react-native'], and unstable_conditionsByPlatform maps platform names to extra conditions. Metro already resolves platform-specific files through its own extension list, so you normally only touch this when a library documents a custom condition.

  7. Reconcile custom resolvers. If you maintain resolver.resolveRequest or use a plugin that redirects modules, make sure it returns null to fall through to Metro's default instead of re-implementing lookup. Symlink-aware resolution happens inside Metro's default resolver, so a hand-written resolver that builds paths manually can quietly bypass it.

  8. Restart with a clean cache. Stop the bundler, then run npx react-native start --reset-cache. The cache is keyed on resolution results, and stale entries from before you flipped the flags will keep reproducing old errors until you clear them.

  9. Verify symlinks work. Import a file from the linked package in a screen, then rebuild. A successful resolve plus hot reload edits from the linked package proving the watcher follows the symlink confirms both halves of symlink support. If edits do not trigger a reload, the folder is missing from watchFolders.

  10. Verify exports behaviour. Find a dependency whose package.json has an exports map and check that the file it points to (often a separate ESM or React Native build) is what ends up in the bundle. A quick way is to add a temporary console.log in a file that only one of the entries exports, or inspect the bundle for the expected file name.

  11. Do a production build. Run your release bundle (npx react-native bundle --platform android --dev false, or your normal release build) to catch resolution differences that only appear without the dev server, such as a package that resolves in development through a fallback but fails in a release bundle.

Common Mistakes

  • Putting unstable_enableSymlinks inside resolver. It belongs at the top level of the config; nested, it is ignored without any warning.
  • Forgetting watchFolders. Symlinked packages resolve but do not trigger rebuilds, which looks like flaky hot reload rather than a configuration problem.
  • Enabling package exports and assuming every subpath still works. Some packages list only some entries in exports; anything not listed is blocked, which is a package authoring issue, not a Metro bug.
  • Clearing the cache with rm -rf node_modules but not restarting the bundler with --reset-cache. The transformed module cache survives that and keeps serving stale resolutions.
  • Mixing package managers in a monorepo. A yarn workspace with an npm install at the root produces duplicate copies and broken links that no Metro setting can fully rescue.
  • Copying an old community config that sets resolver.blacklistRE patterns for duplicate React copies. With symlinks enabled, path-based blacklists may match the linked path and exclude the package you wanted.
  • Assuming exports support also handles conditional import/require differences in CommonJS the way Node does. Metro still bundles for a runtime without Node's module system; unusual dual-package setups may need a resolver hint.

Tips

  • Turn on symlinks even if you do not use a monorepo today. It removes a class of duplicate-module bugs, including the "two copies of React" error.
  • Keep the flags visible and commented in metro.config.js. The unstable_ prefix signals the option name may change in a later release, so a comment noting why each one is set saves rework during upgrades.
  • Test with --reset-cache after every config edit. Metro does not watch its own configuration reliably in all setups.
  • If a package breaks only with exports enabled, check whether it also ships a react-native field. Turning exports back off is a legitimate temporary fix while you open an issue with the package maintainer.
  • Use npx react-native config to see what the CLI thinks your project looks like; a mismatch between that output and metro.config.js explains many confusing resolution failures.

Troubleshooting

Still "Unable to resolve module" after enabling symlinks. Confirm the config file Metro is actually loading is the one you edited: run the dev server and look at the logged config path. Then verify the flag is at the top level and that the linked folder is under a path in watchFolders or the project root.

A workspace package resolves but its own dependencies do not. The dependency was probably installed into the package's private node_modules rather than hoisted, or vice versa. Add the hoisted root node_modules to watchFolders and reinstall cleanly.

Edits in the linked package do not reload. Watch folders are the cause almost every time. Add the package root, restart with --reset-cache and edit again.

Exports flipped a working import into a failure. Set unstable_enablePackageExports back to false, clear the cache, and confirm the app builds. Then reintroduce it package by package by testing your dependency set, and pin or patch the offending package if it lacks the entry you import.

Resolution works in Metro but not in a release build, or the reverse. Check for environment-specific config: Babel plugins, a metro.config.js branch on process.env, or different lockfile state on CI. Run the same install command and the same config on both.

Nothing helps. Delete the Metro cache directory (node_modules/.cache/metro on many setups), reinstall dependencies from the lockfile, and start with --reset-cache. Only then investigate resolver plugins, disabling them one at a time.

Frequently Asked Questions

Do I have to enable symlinks for normal projects?

No. A project that only uses packages installed normally resolves fine without it. It matters for linked packages, monorepos and pnpm's symlinked store layout.

Why is the option named with unstable_?

Because the option name and internals may change in later Metro releases. The behaviour itself is intended for real use; only the flag name is provisional.

Does enabling package exports break older packages?

It can, if a package declares an exports map that omits entries people import directly. Packages with no exports field are resolved the old way, so they usually keep working.

Do these changes affect hot reload or fast refresh?

Symlink support does, indirectly: fast refresh needs the file watcher to see the linked folder. Package exports only affects resolution, not reloading.

Can I use both flags at once?

Yes. They address different parts of resolution and are routinely enabled together in workspaces. Enable them in separate steps so you can tell which one caused a regression.

Where do labels and option names differ?

Metro config keys can change slightly between releases, so check the Metro documentation for the exact version bundled with your React Native release if a key is rejected.