Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with react-native-safe-area-context version < 4 #2251

Closed
julian-hecker opened this issue Jul 28, 2022 · 6 comments
Closed

Incompatible with react-native-safe-area-context version < 4 #2251

julian-hecker opened this issue Jul 28, 2022 · 6 comments

Comments

@julian-hecker
Copy link

Issue Description

Crashes on web when react-native-safe-area-context version < 4.

Throws error Uncaught Error: No safe area value available. Make sure you are rendering at the top of your app.

image

Works fine when react-native-safe-area-context version is >= 4.

Steps to Reproduce / Code Snippets

  1. Initialize a new Expo app with the CLI
  2. Install react-native-safe-area-context@3
  3. Copy the demo into the app
  4. Run on web and see the error

Expected Results

I would expect the app not to crash, or at least a message saying to update react-native-safe-area-context.

Additional Information

  • Nodejs version: 16.51.1
  • React version: 17.0.2
  • React Native version: 0.68.2
  • react-native-gifted-chat version: ^1.0.4
  • Platform(s) (iOS, Android, or both?): Web
  • TypeScript version: ~4.3.5
  • react-native-safe-area-context version: 3.3.2 (Expo SDK 44 Default)
@l2aelba
Copy link

l2aelba commented Aug 2, 2022

Got issue about SafeArea also but

Invariant Violation: Tried to register two views with the same name RNCSafeAreaProvider

@parnekov
Copy link

Fixed by the answer: https://stackoverflow.com/questions/72469920/invariant-violation-tried-to-register-two-views-with-the-same-name-rncsafeareap/72470161#72470161

installed react-native-safe-area-context@4.3.1
before installing a new version of "react-native-safe-area-context" you should check what version in "react-native-gifted-chat": npm list react-native-safe-area-context and get version from
image

@mohas
Copy link

mohas commented Dec 8, 2022

as we are using yarn there is no dedupe, it is being done automatically, for us the issue was pinning a specific version of react-native-safe-area-context@4.3.4, after changing to ^4.3.4 it worked

@abumubarak-dev
Copy link

I was facing the same issue
i had to uninstall and install "react-native-safe-area-context": "^4.4.1",

@NilsBaumgartner1994
Copy link

facing the same problem

@Johan-dutoit
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants