weahforsage / react-native-animated-pagination-dots

MIT License
248 stars 34 forks source link

Error: Tried to register two views with the same name RNSVGSvgView #18

Open kirill-dev-pro opened 2 years ago

kirill-dev-pro commented 2 years ago

Got error from running an example from readme

Error: Requiring module "node_modules/react-native-animated-pagination-dots/src/index.tsx", which threw an exception: Invariant Violation: Tried to register two views with the same name RNSVGSvgView

react-native 0.64.3

MykhailoTurok commented 2 years ago

I have the same issue

kriss-u commented 2 years ago

This is because you are using a different version of react-native-svg on your project dependency. But, this package uses version ^12.1.0. This is very frustrating though. You have to revert back to the same version.

@weahforsage Can you please fix these dependencies issues? Maybe put it into peer dependencies. I don't know about creating modules. Otherwise, I would've sent a PR.

kriss-u commented 2 years ago

@weahforsage Can you please look into this sooner? This is causing some trouble at my end as well.

ChrisMuga commented 2 years ago

Have you tried wrapping your components in a <SafeAreaView/> instead of <View/>?

kashaudhan commented 2 years ago

To fix the issue I tried two workaround:

  1. Remove the node_module folder & run npm dedupe to fix package duplication (note: might not work in some cases) or
  2. comment Line number 5 where LiquidLike is being imported & remove LiquidLike when exported from package's index file, only if you are not using LiquidLike component (note: you'll have to do this every time when you add or remove any package)

These two things worked for me. Hope this helps.