October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Splitting One React Native App into Two: Bugs That Have No Error Message

A React Native app can build after a split and still load the wrong code. Check Metro visibility, dependency identity, native linking, and platform bundle settings in order.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A React Native app can install and build successfully after a split yet still load the wrong JavaScript, resolve a second copy of a package, omit a native module, or behave differently between debug and release. Diagnose the boundaries in order: Metro file visibility, resolved dependency identity, native linking, Android bundle settings, then iOS project configuration. A successful build confirms that a build completed—not that every layer used the intended path or copy.

1. Can Metro see the source files the app is meant to use?

Start with the Metro configuration actually used by the app you are running. Check its effective projectRoot and watchFolders, then trace every imported workspace package and symlink to its target. Each required file must be within Metro’s visible roots. This is not only a development file-watching concern: Metro’s documentation says files must be visible for offline builds too.

  • Confirm the app’s project root is the one you expect, especially if you created a second app or moved it into a workspace.
  • Make the workspace root or the specific shared-source locations reachable through watchFolders.
  • Include the targets of symlinks, not only the directory containing the symlink.
  • For a failing import or asset, record the path Metro is resolving before changing configuration.

React Native 0.73 and later

React Native 0.73 enabled Metro symlink support by default, but that does not mean every monorepo layout works without configuration. The React Native team’s 2023 release announcement says, “We are aware there are still edge cases when using React Native in a monorepo layout.” It also notes that template projects still need external folders configured. Check your installed version and actual workspace layout rather than treating the default as a guarantee.

2. Is the app resolving one intended copy of each important package?

Next, inspect the installed dependency graph, not just the versions written in package manifests. Workspace hoisting and package-manager resolution can leave a package available from more than one installed location. This matters especially for React identity and native modules: Expo’s monorepo guide warns that duplicate React versions in one app can cause runtime errors, and that duplicate React Native versions in a monorepo are unsupported. It also notes that only one version of a native module can be compiled into an app build.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the explanation command for your package manager to find why versions are present:

  • npm why react or npm why react-native
  • yarn why react or yarn why react-native
  • pnpm why --depth=10 react or pnpm why --depth=10 react-native
  • bun pm why react or bun pm why react-native

Repeat the check for relevant native modules and framework packages. Capture the resolved locations as well as the reported versions; matching version strings alone do not prove that an app is loading the same installed copy.

Expo monorepo behavior is SDK-specific

Do not apply Expo’s behavior automatically to a bare React Native app. Expo’s current monorepo guide describes experiments.autolinkingModuleResolution as an option in SDK 54 and says SDK 55 enables it automatically for apps in monorepos. Older SDKs and bare projects may follow different resolution behavior, so confirm your SDK and configuration before copying a setting.

3. Is the native implementation included in the app that consumes it?

A JavaScript import resolving correctly does not establish that its native code is present. React Native’s iOS library-linking guidance explains that native dependencies are drawn from the consuming app’s dependencies and devDependencies in package.json. If a native library is omitted from that app’s dependency declaration or not linked into its native project, using it can fail even when JavaScript can import the package.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Check that the app which needs the feature declares the native package, rather than relying on another workspace package’s declaration.
  • Verify autolinking or manual linking includes the intended package copy.
  • Compare the dependency path selected by JavaScript with the library path selected by native tooling.

Workspace hoisting can also change where React Native itself is installed. Expo’s monorepo guide explains that standard relative paths in native build files may no longer point to the right location after hoisting, and documents dynamically resolving package locations. Inspect hard-coded paths in your own project rather than assuming the template’s original relative paths remain valid.

4. Does the Android variant actually generate a JavaScript bundle?

In Android’s React Native Gradle Plugin configuration, inspect the paths for root, reactNativeDir, codegenDir, and cliFile. Each must correspond to the app and workspace layout being built. A path that still points at the original app or an old dependency location can leave the build apparently healthy while using the wrong configuration.

Check debuggableVariants

The plugin skips shipping a JavaScript bundle for variants marked debuggable; those variants require Metro. If a build works while Metro is running but an artifact has no bundle, inspect this setting and the variant you actually built. Do not mark a variant intended for publishing as debuggable unless requiring Metro is deliberate. Confirm bundle generation using the built artifact and its variant, not just the Gradle task’s success message.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

5. Do iOS and Android agree on the app’s Metro and native-library setup?

When one platform behaves differently, compare its entry file, Metro port, native dependency setup, and bundle behavior with the other platform’s configuration. React Native troubleshooting specifically calls out updating the Xcode project’s bundle-port references when Metro uses a non-default port. A Metro server listening on one port does not help an iOS project still configured to contact another.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For an iOS native feature that is missing or fails when called, inspect the linked frameworks and CocoaPods setup as well as the JavaScript dependency graph. JavaScript package resolution and native integration are separate checks; passing one does not verify the other.

6. How can you isolate a bug without changing several things at once?

Treat each explanation as a hypothesis, not a diagnosis. For example, inconsistent sibling-package imports or assets point toward a Metro visibility or resolution check; runtime differences may involve duplicate React or framework packages; and a JavaScript import with a failing native feature calls for a native-linking check. A debug build that works through Metro while a packaged artifact lacks a bundle calls for an Android variant check. None of those symptoms alone proves its likely cause.

  1. Record the exact app, platform, build variant, and artifact that shows the problem.
  2. Capture Metro’s effective roots and the resolved path for the affected import or asset.
  3. Save the package-manager explanation output for React, React Native, and the implicated modules.
  4. Inspect the consuming app’s dependency declarations and native linking configuration.
  5. Compare the platform-specific paths, ports, and bundle settings relevant to that artifact.
  6. Change one layer at a time, rebuild the same variant, and compare the result with the saved evidence.

This order distinguishes a file-visibility problem from package identity, native inclusion, or bundle-generation behavior. A green install or build is useful evidence that a command completed; it is not proof that the split’s boundaries point to the intended code.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.