question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RN 0.70.0 ViewPropTypes & AppRegistry issue

See original GitHub issue

Description

I upgraded my react-native project from ~0.67.1 to 0.70.0, I followed all the guidance here: https://react-native-community.github.io/upgrade-helper/?from=0.67.1&to=0.70.0.

After the upgrade process, error start showing up saying some errors below: Screen Shot 2022-09-06 at 21 13 00

Version

0.70.0

Output of npx react-native info

System: OS: macOS 12.2.1 CPU: (8) arm64 Apple M1 Memory: 1.15 GB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm Watchman: Not Found Managers: CocoaPods: 1.11.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: 11.0.14.1 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.0 => 0.70.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

  • Upgrade react native version to 0.70.0
  • Removed node_modules directory and Pods directory to get clean package installation
  • Execute yarn install and pod install
  • Run the metro by using yarn run start
  • Run ios by yarn ios

The build works perfectly fine, but then when the emulator shows up, it stuck on the Splash Screen and console log shows the error like the attached file above.

Snack, code example, screenshot, or link to a repository

Already provided above.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
allemanfredicommented, Sep 9, 2022

@hicath Try this:

diff --git a/node_modules/react-native/index.js b/node_modules/react-native/index.js
index d59ba34..349b4dd 100644
--- a/node_modules/react-native/index.js
+++ b/node_modules/react-native/index.js
@@ -435,32 +435,16 @@ module.exports = {
   },
   // Deprecated Prop Types
   get ColorPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'ColorPropType has been removed from React Native. Migrate to ' +
-        "ColorPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require('deprecated-react-native-prop-types').ColorPropType
   },
   get EdgeInsetsPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'EdgeInsetsPropType has been removed from React Native. Migrate to ' +
-        "EdgeInsetsPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require('deprecated-react-native-prop-types').EdgeInsetsPropType
   },
   get PointPropType(): $FlowFixMe {
-    invariant(
-      false,
-      'PointPropType has been removed from React Native. Migrate to ' +
-        "PointPropType exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require('deprecated-react-native-prop-types').PointPropType
   },
   get ViewPropTypes(): $FlowFixMe {
-    invariant(
-      false,
-      'ViewPropTypes has been removed from React Native. Migrate to ' +
-        "ViewPropTypes exported from 'deprecated-react-native-prop-types'.",
-    );
+    return require('deprecated-react-native-prop-types').ViewPropTypes
   },
 };
2reactions
hicathcommented, Sep 7, 2022

Good news, it finally works for me. I implemented the patch and upgraded some used dependencies that has some updates related to latest RN adjustments

Read more comments on GitHub >

github_iconTop Results From Across the Web

ViewPropTypes has been removed from React Native. Migrate ...
Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. ERROR Invariant Violation: Module AppRegistry is not a registered ...
Read more >
invariant violation: viewproptypes has been removed from react ...
Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. ERROR Invariant Violation: Module AppRegistry is not a registered callable ...
Read more >
react-native-screens - npm
To make sure that there are no issues with screen orientation you ... To configure react-navigation to use screens instead of plain RN...
Read more >
types/react-native/index.d.ts - UNPKG
224, * @throws {Error} When called not during an eventing cycle ... 492, * `AppRegistry` is the JS entry point to running all...
Read more >
React Native Tutorial - ERROR Invariant Violation - YouTube
ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found