software-mansion / software-mansion/react-native-svg

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

Open
#2,895 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Repro provided
Dominant language
TypeScript
Stars
8k
Forks
1.2k
Avg merge
10d 9h
Merged PRs (30d)
2

Description

Description

VM9 &platform=androi…rver&shallow=true:1 Invariant Violation: Tried to register two views with the same name RNSVGCircle
at invariant (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…nly=false&runModule=true&excludeSource=true&sourcePaths=url-server:2341:26)
at register (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…nly=false&runModule=true&excludeSource=true&sourcePaths=url-server:8538:28)
at get (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…nly=false&runModule=true&excludeSource=true&sourcePaths=url-server:7327:43)
at anonymous (http://localhost:8081/node_modules/react-native-svg/src/fabric/CircleNative…modulesOnly=true&runModule=true&sourcePaths=url-server&shallow=true:46:136)
at loadModuleImplementation (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…Only=false&runModule=true&excludeSource=true&sourcePaths=url-server:260:14)
at guardedLoadModule (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…Only=false&runModule=true&excludeSource=true&sourcePaths=url-server:161:47)
at metroRequire (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…sOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:88:92)
at runUpdatedModule (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…Only=false&runModule=true&excludeSource=true&sourcePaths=url-server:508:19)
at metroHotUpdateModule (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…Only=false&runModule=true&excludeSource=true&sourcePaths=url-server:400:40)
at define (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…sOnly=false&runModule=true&excludeSource=true&sourcePaths=url-server:38:26)
at eval (http://localhost:8081/node_modules/react-native-svg/src/fabric/CircleNative…et&modulesOnly=true&runModule=true&sourcePaths=url-server&shallow=true:1:4)
at inject (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…ly=false&runModule=true&excludeSource=true&sourcePaths=url-server:51207:11)
at forEach (native)
at injectUpdate (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…ly=false&runModule=true&excludeSource=true&sourcePaths=url-server:51211:25)
at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…ly=false&runModule=true&excludeSource=true&sourcePaths=url-server:51263:23)
at call (native)
at emit (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…ly=false&runModule=true&excludeSource=true&sourcePaths=url-server:51478:33)
at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…ly=false&runModule=true&excludeSource=true&sourcePaths=url-server:51246:23)
at invoke (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…ly=false&runModule=true&excludeSource=true&sourcePaths=url-server:46562:31)
at dispatch (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…ly=false&runModule=true&excludeSource=true&sourcePaths=url-server:46518:13)
at dispatchEvent (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…ly=false&runModule=true&excludeSource=true&sourcePaths=url-server:46473:17)
at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…ly=false&runModule=true&excludeSource=true&sourcePaths=url-server:46064:29)
at apply (native)
at emit (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…nly=false&runModule=true&excludeSource=true&sourcePaths=url-server:2127:40)
at apply (native)
at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…ly=false&runModule=true&excludeSource=true&sourcePaths=url-server:1993:200)
at emit (http://localhost:8081/index.bundle//&platform=android&dev=true&lazy=true&mi…nly=false&runModule=true&excludeSource=true&sourcePaths=url-server:2005:68)

Steps to reproduce

The SVG components work fine the first time, but show errors after commenting ({/* */}) to uncommenting ( ) after reload.

Snack or a link to a repository

https://github.com/sureshkumaroffl/mytest

SVG version

15.15.3

React Native version

0.84.1

Platforms

Android

JavaScript runtime

None

Workflow

React Native

Architecture

None

Build type

None

Device

Android emulator

Device model

Pixel_5

Acknowledgements

Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked mytest repository with React Native 0.84.1 and react-native-svg 15.15.3, then reproduce the comment/uncomment reload sequence on Android. Inspect react-native-svg/src/fabric/CircleNative from the stack trace and verify that reloading after toggling SvgComponent no longer reports duplicate RNSVGCircle registration.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, react-native, typescript
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.