requireNativeComponent was not found in the UIManager: how to fix it

This error means the JavaScript asks for a native view that the installed app binary does not contain. The usual fix is to rebuild the native app after installing the library. In Expo, it means Expo Go does not include that library, so you need a development build.

Last updated

The error

Invariant Violation: requireNativeComponent: "RNSVGPath" was not found in the UIManager.

The quoted name is the native view, for example RNSVGPath from react-native-svg, RNCWebView from react-native-webview, or RNCSafeAreaProvider from react-native-safe-area-context. Search node_modules for that name to find which package it comes from.

Which cause applies to you?

  • You just installed the package: the native app was not rebuilt. See Rebuild the native app.
  • You run the project in Expo Go: Expo Go only contains the native modules from the Expo SDK. See Expo Go.
  • iOS only: pods were not installed. See Install pods.
  • It worked before, then broke after an upgrade: two copies of the package are installed. See Duplicate packages.

Rebuild the native app

Libraries with native code are linked at build time. Fast Refresh and a Metro restart do not add native code to an app that is already installed. Rebuild and reinstall it:

# React Native CLI
cd ios && pod install && cd ..
npx react-native run-ios
npx react-native run-android

# Expo with a development build
npx expo run:ios
npx expo run:android

If you build in the cloud with EAS, run a new development build (eas build --profile development) and install it. The old build on the device stays broken until you replace it.

Expo Go does not include the library

Expo Go is a prebuilt app. It contains the native modules bundled with its Expo SDK version and nothing else. A third-party library with native code fails in Expo Go with this error, even though npm install succeeded.

  1. Check whether the library is in the SDK: run npx expo install with the package name, for example npx expo install react-native-svg. Packages in the SDK get the version Expo Go expects.
  2. If the library is not in the SDK, create a development build: npx expo install expo-dev-client, then npx expo run:ios / run:android or an EAS development build.

A package that is in the SDK can still fail when its version does not match. npx expo install --fix aligns all of them with your SDK. Check what your SDK bundles on the Expo SDK compatibility table.

iOS: install pods

On a bare React Native project, a new native dependency needs pod install before the iOS build. Without it, Xcode builds an app without the library and you get the error at runtime instead of a build failure.

cd ios
pod install
cd ..
npx react-native run-ios

If pod install itself fails after an upgrade, see CocoaPods could not find compatible versions.

Duplicate packages

Two copies of the same native library register the view twice or under the wrong copy. This often happens with react-native-svg, react-native-reanimated and react-native-safe-area-context, when a dependency pins its own version. List the installed copies:

npm ls react-native-svg
# or
yarn why react-native-svg

If there is more than one version, add an overrides (npm) or resolutions (Yarn) entry for the version your app uses, reinstall, and rebuild the native app.

Verify the fix

Delete the app from the device or simulator, install the new build, and open the screen that failed. If the error names a different view now, repeat the steps for that package.

Still seeing it after a clean rebuild? Send me the error and your package.json, and I will find which native module is missing.

Get help with my bug

Sources