question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Hi, when using @walletconnect/react-native-dapp with expo, the following error occurs:

Invariant Violation: Tried to register two views with the same name RNSVGRect
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0
at [native code]:null in flushedQueue
at [native code]:null in invokeCallbackAndReturnFlushedQueue

I think the problem is that @walletconnect/react-native-dapp is used a very old version of react-native-svg. I tried to solve it like here https://stackoverflow.com/questions/54543324/react-native-svg-error-tried-to-register-two-views-with-the-same-name-rnsvgre but it didn’t work.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:21

github_iconTop GitHub Comments

7reactions
PetervEcommented, Apr 1, 2022

Below changes in package.json works for me.

  "dependencies": {
    "@walletconnect/react-native-dapp": "1.7.7",
    "react-native-svg": "12.3.0",
    "react-native-qrcode-svg": "6.1.2"
  },
  "resolutions": {
    "react-native-svg": "12.3.0",
    "react-native-qrcode-svg": "6.1.2"
  },
1reaction
IB3Ncommented, May 25, 2022

Overriding the package with npm v8.3+ worked for me 👍

"overrides": {
  "react-native-svg": "~12.1.1"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

(react-native-svg Error) "Tried to register two views with the ...
I am using yarn and npm to add modules. I get an error message: "Tried to register two views with the same name...
Read more >
Tried to register two views with the same name RNSVGPath
As you can see in the screenshot, I get the issue when I tried use 2 libraries that use react-native-svg as dependency.
Read more >
Tried to register two views with the same name RNSVGSvgView
I want to use svg, and if I use it I get the error message. I use expo and have installed expo install...
Read more >
[Solved]-(react-native-svg Error) "Tried to register two views ...
Coding example for the question (react-native-svg Error) "Tried to register two views with the same name RNSVGRect"-Reactjs.
Read more >
Facing the following issue:. (react-native-svg Error) “Tried to…
(react-native-svg Error) “Tried to register two views with the same name RNSVGRect”. “Facing the following issue:” is published by Irfan ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found