React-native-chart-kit: Tried to register two views with the same name RNSVGPath

Created on 21 Jun 2018  ยท  15Comments  ยท  Source: indiespirit/react-native-chart-kit

Tried to register two views with the same name RNSVGPath
register
D:WorksTodocDesarrolloAppstodocnode_modulesreact-nativeLibrariesRendererReactNativeRenderer-dev.js:14108:4
createReactNativeComponentClass
D:WorksTodocDesarrolloAppstodocnode_modulesreact-nativeLibrariesRendererReactNativeRenderer-dev.js:14674:18
default
D:WorksTodocDesarrolloAppstodocnode_modulesreact-native-chart-kitnode_modulesreact-native-svglibcreateReactNativeComponentClass.js:5:38

D:WorksTodocDesarrolloAppstodocnode_modulesreact-native-chart-kitnode_modulesreact-native-svgelementsPath.js:34:50
loadModuleImplementation
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:214:12
guardedLoadModule
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:148:36
_require
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:132:20

D:WorksTodocDesarrolloAppstodocnode_modulesreact-native-chart-kitnode_modulesreact-native-svgelementsRect.js:2
loadModuleImplementation
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:214:12
guardedLoadModule
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:148:36
_require
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:132:20

D:WorksTodocDesarrolloAppstodocnode_modulesreact-native-chart-kitnode_modulesreact-native-svgindex.js:1
loadModuleImplementation
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:214:12
guardedLoadModule
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:148:36
_require
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:132:20

D:WorksTodocDesarrolloAppstodocnode_modulesreact-native-chart-kitsrcabstract-chart.js:3
loadModuleImplementation
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:214:12
guardedLoadModule
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:148:36
_require
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:132:20

D:WorksTodocDesarrolloAppstodocnode_modulesreact-native-chart-kitindex.js:1
loadModuleImplementation
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:214:12
guardedLoadModule
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:148:36
_require
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:132:20

D:WorksTodocDesarrolloAppstodocsrcscreensStatisticsScreen.js:5
loadModuleImplementation
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:214:12
guardedLoadModule
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:148:36
_require
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:132:20

D:WorksTodocDesarrolloAppstodocsrcscreensTabsScreen.js:12
loadModuleImplementation
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:214:12
guardedLoadModule
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:148:36
_require
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:132:20

D:WorksTodocDesarrolloAppstodocApp.js:10
loadModuleImplementation
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:214:12
guardedLoadModule
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:148:36
_require
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:132:20

D:WorksTodocDesarrolloAppstodocindex.js:2
loadModuleImplementation
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:214:12
guardedLoadModule
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:141:45
_require
D:WorksTodocDesarrolloAppstodocnode_modulesmetrosrclibpolyfillsrequire.js:132:20
global code


{
"name": "todoc",
"version": "4.0.0",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"moment": "^2.22.2",
"react": "^16.4.0",
"react-native": "^0.55.4",
"react-native-animatable": "^1.3.0",
"react-native-calendars": "^1.19.3",
"react-native-chart-kit": "^0.2.0",
"react-native-datepicker": "^1.7.2",
"react-native-device-info": "^0.21.5",
"react-native-elements": "^0.19.1",
"react-native-event-listeners": "^1.0.3",
"react-native-floating-action": "^1.10.1",
"react-native-keyboard-aware-scroll-view": "^0.5.0",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-material-bottom-navigation": "^1.0.0",
"react-native-modal": "^6.1.0",
"react-native-modal-selector": "0.0.27",
"react-native-modest-checkbox": "^3.0.0",
"react-native-phone-call": "^1.0.6",
"react-native-popup-menu": "^0.13.1",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-signalr": "^1.0.6",
"react-native-sms-android": "^0.4.1",
"react-native-svg": "^6.3.1",
"react-native-swiper": "^1.5.13",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.3.0",
"realm": "^2.8.2",
"victory-native": "^0.18.0"
},
"devDependencies": {
"babel-jest": "22.4.3",
"babel-preset-react-native": "4.0.0",
"jest": "22.4.3",
"react-test-renderer": "16.3.0-alpha.1"
},
"jest": {
"preset": "react-native"
}
}

Most helpful comment

When you already have react-native-svg as a dependency this error happens,As work around ,I removed react-native-svg from chart-kit node module folder.
Please fix this issue

All 15 comments

I am facing the same problem. Anyways to fix this ?

Sorry for the late response. I just updated all dependencies for this library.
You can also checkout a working example.

Still have the same issue.

Tried to install and test this package, getting the same errors

When you already have react-native-svg as a dependency this error happens,As work around ,I removed react-native-svg from chart-kit node module folder.
Please fix this issue

Perhaps this library can use "react-native-svg": "*" as its peer dependency. That would leave version compatibility ambiguous but allows different versions. I'm on react-native-svg 8.0.3, but I'd bet the API hasn't changed to the point of being incompatible with 6.4.1.

I have the same issue because this library uses Expo, when I create a project using Expo the react-native-svg tries to register RNSVGPath again.

npm list react-native-svg
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ””โ”€โ”ฌ [email protected]
โ””โ”€โ”ฌ [email protected]
โ””โ”€โ”€ [email protected]

I have the same issue because this library uses Expo, when I create a project using Expo the react-native-svg tries to register RNSVGPath again.

npm list react-native-svg
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ””โ”€โ”ฌ [email protected]
โ””โ”€โ”ฌ [email protected]
โ””โ”€โ”€ [email protected]

Any resolution yet?

I have the same issue because this library uses Expo, when I create a project using Expo the react-native-svg tries to register RNSVGPath again.

npm list react-native-svg
โ”œโ”€โ”ฌ [email protected]
โ”‚ โ””โ”€โ”€ [email protected]
โ””โ”€โ”ฌ [email protected]
โ””โ”€โ”ฌ [email protected]
โ””โ”€โ”€ [email protected]

Any solution to this yet? I am trying to use victory-native on expo and I am running into this issue

Why has this issue been closed? It's still a problem in the current version of this module?

Today I upgraded my app to use Expo v32, I started facing same issue. Any solution for this problem?

@OmniAsetty I resolved this issue with below

import React from "react";
import { View } from "react-native";
import { LineChart, YAxis, Grid } from "react-native-svg-charts";
import "react-native-svg";
import { Button } from "react-native-elements";
import Icon from "react-native-vector-icons/FontAwesome";

https://github.com/DanishDeveloper360/climate-control-app-hr/blob/master/screens/SettingsScreen.js

Feel free to look into my code, but I resolved it with this line :
import "react-native-svg";

Also, this error sometimes comes when you access your uninitialised state, I know it is stupid but I happened don;t for what reason.

Thank you for prompt response! I will give a try and let you know.

Is package 'react-native-chart-kit' and 'react-native-svg-charts' are same?
In 'react-native-chart-kit', LineChart component accepts the data in this format
const data = { labels: [], datasets: [{ data: [] }] };
but react-native-svg-charts, LineChart component accepts the data as [].

I got it resolved! I am not 100% sure about this solution for every case, but in my case, my Expo cache and NPM cache was messed up. I had to delete the node_modules folder, do npm install and start the Expo with '-c' to clear the cache before it start. After this, it worked like a champ!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

violabg picture violabg  ยท  6Comments

ighormartins picture ighormartins  ยท  3Comments

mcama picture mcama  ยท  5Comments

dahudson88 picture dahudson88  ยท  5Comments

azui007 picture azui007  ยท  6Comments