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

Tried to register two views with the same name RNSScreen #15

Closed
raphaelrk opened this issue Sep 20, 2018 · 20 comments
Closed

Tried to register two views with the same name RNSScreen #15

raphaelrk opened this issue Sep 20, 2018 · 20 comments

Comments

@raphaelrk
Copy link

raphaelrk commented Sep 20, 2018

Getting the following issue when I add import { useScreens } from 'react-native-screens'; in my App.js

simulator screen shot - iphone se - 2018-09-20 at 15 25 00

simulator screen shot - iphone se - 2018-09-20 at 15 25 02

react-native info

Environment:
OS: macOS High Sierra 10.13.5
Node: 10.10.0
Yarn: 1.9.4
npm: 6.4.1
Watchman: 4.9.0
Xcode: Xcode 9.4.1 Build version 9F2000
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4

Etc

"expo": "^30.0.0",
"react-native-screens": "^1.0.0-alpha.12",

Happens in both dev and production mode
Was not able to reproduce in a simple snack

@kantorm
Copy link

kantorm commented Sep 21, 2018

I had the same issue but with the app created with react-native init

@jaydenwindle
Copy link

jaydenwindle commented Sep 23, 2018

I'm also running into this issue using in an ejected CRNA app alongside react-navigation: "2.14.0".

The app I'm working on uses multiple types of nested navigators (stack, switch, drawer, tab) and has multiple stack navigators. I wonder if having multiple navigators setup is part of the issue here?

@kmagiera
Copy link
Member

The issue is related to the fact react-native-screens package is installed several times under node_modules in different versions. I am investigating a possible cause of this but one hint that I have for the time being is to try upgrading yarn and performing a clean install with yarn instead of npm

@MaxInMoon
Copy link

@kmagiera what do you mean by "installed several times under node_modules"?

@tuvshinbatgeru
Copy link

@kmagiera any solution for that?

@tuvshinbatgeru
Copy link

error appears when upgrading react-navigation to v2.16.0. Since react navigation uses react-native-screens.

@kelset
Copy link
Contributor

kelset commented Oct 22, 2018

So, related to this:

can't really investigate it more atm, but yeah there is probably something with a clash.

@lanceharper
Copy link

^ Bumping react-native-screens for 2.x in a fork of react-navigation addressed this issue for me: lanceharper/react-navigation@1df42a4

I can submit this back to the main repo if there is no preferred alternative.

@brentvatne
Copy link
Contributor

2.x of react-navigation depends on ^1.0.0-alpha.11 which should match 1.0.0-alpha.15. however, another package has installed react-native-screens with a more strict dependency that doesn't match this range, for example if your package.json explicitly includes [email protected], then you will end up with 2 copies of react-native-screens. i'd check your yarn.lock to see what package is installing which version of it.

useful reference:
https://semver.npmjs.com/
screen shot 2018-10-23 at 1 18 07 pm

@kelset
Copy link
Contributor

kelset commented Nov 2, 2018

(update: with ReactNav v3 the issue disappears 👌)

@jenshandersson
Copy link

Had the same issue, with Expo 31.0.5 and RN 2.18.2.
Solved the issue by removing react-native-screens from my own dependencies. (ie using the already required version of rn-screens.

"dependencies": {
  "expo": "^31.0.4",
  "react": "16.5.0",
  "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz",
  "react-navigation": "^2.18.0"
}

@hufkens
Copy link
Contributor

hufkens commented Feb 8, 2019

Is there a way to solve this error when using reac-native-screens as a local_module?

I'm currently trying to fix this library for tvOS but because it is a dependency now of @react-navigation/native I always get this error now. Probably because it gets loaded twice (once from local_module and once for as a dependency for react-navigation)

Any tips for that?

lukePeavey added a commit to lukePeavey/react-native-photos that referenced this issue Mar 15, 2019
Fix for: software-mansion/react-native-screens#15

Removing react-native-gesture-hanler from package.json fixed the
problem.
@ranjitatwal30
Copy link

I deleted the react-native-gesture-handler from node_modules/expo/ and it worked for me. It took me so much time to figure it.

@oussamaAbdelwahed
Copy link

@ranjitatwal30 , thanks a lot man , it saves e a lot of time 👍

@altab
Copy link

altab commented Apr 1, 2019

@ranjitatwal30 it works for me too !!! thank you !!!

@asimonv
Copy link

asimonv commented Apr 10, 2019

I deleted the react-native-gesture-handler from node_modules/expo/ and it worked for me. It took me so much time to figure it.

it works!

@seysdev
Copy link

seysdev commented May 26, 2019

I deleted the react-native-gesture-handler from node_modules/expo/ and it worked for me. It took me so much time to figure it.

thank u.

@Pandazaur
Copy link

For people not using Expo:

I had the problem with react-navigation. I checked in yarn.lock what was the exact version of react-native-screensused by the react-navigation package and installed EXACTLY the same version and now it works !

My yarn.lock was:

react-native-screens@^1.0.0-alpha.11:
  version "1.0.0-alpha.15"
  resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-1.0.0-alpha.15.tgz#5b5a0041310b46f12048fda1908d52e7290ec18f"

So i installedyarn add react-native-screens@^1.0.0-alpha.11

@WoLewicki
Copy link
Member

Can someone tell if the issue still exists in the newer versions of Expo and Screens?

@WoLewicki
Copy link
Member

I am closing it due to no response in more than 30 days. Feel free to comment to reopen it.

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