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

I get a error of Invariant Violation: Tried to register two views with the same name GestureHandlerRootView #83

Open
6ixline opened this issue Jun 10, 2022 · 7 comments

Comments

@6ixline
Copy link

6ixline commented Jun 10, 2022

I get a error of Invariant Violation: Tried to register two views with the same name GestureHandlerRootView when i use react-native-animated-charts if i uninstall it everything work fine but whenever i import { ChartDot, ChartPath, ChartPathProvider } from '@rainbow-me/animated-charts'; to use it i get the error

@ddikodroid
Copy link

@theIYD
Copy link

theIYD commented Jul 7, 2022

Facing the same error.

Using GestureHandlerRootView to wrap the root for the bottom sheet package on Android.

Using Expo 45 with [email protected].

@alwye
Copy link

alwye commented Jul 10, 2022

I might've managed to resolve this issue, although it wasn't a perfect solution.

My package.json required react-native-gesture-handler@~2.2.1

I noticed in my yarn.lock file that two versions were required simultaneously: ~2.2.1 directly and ^1.7.0 by react-native-animated-charts, which is this library:

"@rainbow-me/animated-charts@^1.0.0-alpha.6":
  version "1.0.0-alpha.6"
  resolved "https://registry.yarnpkg.com/@rainbow-me/animated-charts/-/animated-charts-1.0.0-alpha.6.tgz#b21a6886d4f662b7c12c10d3d2398f9e0d73d5bc"
  integrity sha512-mJMKiHLxuU5FPIn/WR+klzA4Ug68zI+eCaqiBjd+s1QGfO2EF/za1PgN0GtCmm5iFDqdnE8FEoRk8RAI5p9WtQ==
  dependencies:
    react-native-gesture-handler "^1.7.0"
    react-native-haptic-feedback "^1.10.0"
    react-native-reanimated "^2.0.0-alpha.5"
    react-native-svg "^12.1.0"

What I changed to fix the issue:

I had to change my dependency defined in package.json to the older version:

{
    ...,
    "dependencies": {
        ...,
        "react-native-gesture-handler": "^1.7.0"
    }
}

I consider this a temporary solution and ideally the underlying dependency should be updated here:

https://github.com/rainbow-me/react-native-animated-charts/blob/master/package.json#L20

@tradebulls
Copy link

Delete following package -- @rainbow-me/node-modules/react-native-gesture-handler. Rebuild the project and the issue is solved. Let me know if this helps

@alwye
Copy link

alwye commented Jul 18, 2022

@tradebulls it might only work for manual builds. If you’re EAS (Expo Application Services) or any other kind of automated builds, that will fail

@Guilherme-Mourelhe
Copy link

Guilherme-Mourelhe commented Aug 21, 2022

Delete following package -- @rainbow-me/node-modules/react-native-gesture-handler. Rebuild the project and the issue is solved. Let me know if this helps

Use npm dedupe at node_modules and this It worked for me, thank God! Thanks bro.

@crstnmac
Copy link

crstnmac commented Dec 5, 2022

Facing the same error.

Using GestureHandlerRootView to wrap the root for the bottom sheet package on Android.

Using Expo 45 with [email protected].

Did you find any possible fix for this???

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