react-native
react-native copied to clipboard
TypeError: undefined is not an object (evaluating '_reactNative.Platform.OS')
Description
Recently updated react to 18 version, and since that I'm not able to build my app. At first I've received "ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types" and fixed this by using babel-plugin-module-resolver]. But now I get this error:
TypeError: undefined is not an object (evaluating '_reactNative.Platform.OS')
Version
0.69.1
Output of npx react-native info
System: OS: macOS 12.0.1 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 62.84 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 14.18.2 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 6.14.15 - /usr/local/bin/npm Watchman: 2021.10.18.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 13.3/13E113 - /usr/bin/xcodebuild Languages: Java: 11.0.15 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.0.0 => 18.0.0 react-native: ^0.69.1 => 0.69.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
react-native run-ios
Snack, code example, screenshot, or link to a repository
No response
I could solve this problem instead of using Plataform.OS
, I used ReactNative.Platform.OS
. Hope that help.
same problem