react-native-chart-kit: `expo start --dev-client`: Invariant Violation: requireNativeComponent: "RNSVGRect" was not found in the UIManager

Note: see https://github.com/indiespirit/react-native-chart-kit/issues/614#issuecomment-1419656489 for steps to resolve


When running with

  • expo start — ✅ The basic sample LineChart renders fine
  • expo start --dev-client ❌ — The app crashes with ~42 errors like
    • Invariant Violation: requireNativeComponent: “RNSVGRect” was not found in the UIManager

    "expo": "~45.0.0",
    "react-native-chart-kit": "^6.12.0",

I tried following the steps in these other issues, with no success

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21

Most upvoted comments

Maybe you have forgot to install ‘react-native-svg’ as mentioned in the document.

Maybe safe to close, with action item to update the README

I eventually got around this by publishing a new dev-client build

  • eas build --profile development --platform ios

Would be nice to have some docs for this gotcha!

Deleting the development client on my android and creating a new one with eas build --profile development --platform android did the trick for me. I guess react-native-svg contains some native code API, probably why we need a new build after downloading it.

thanks for quick reply @thiskevinwang

Did you try running expo prebuild --yarn before? (should update your ios & android dirs)

no, i will try that.

@lucksp are you running eas build --profile development --platform ios?

yes, i am running eas build --profile development --platform ios

FWIW: my ./ios/Podfile.lock has several references to RNSVG

I guess I will find out when I prebuild

EDIT:

I read through the docs and am not entirely sure why I need to prebuild…

You can try uninstall your app from the emulator/device and try rebuild it again.

expo prebuild did nothing but npx react-native run-ios solved issue for me

It’s been a long time since I’ve touched this, but has everyone/anyone tried the following commands?

  • prebuild
  • then build dev client
  • install the dev client
  • run local development
expo prebuild --yarn
eas build --profile development --platform ios