JesperLekland / react-native-svg-charts

📈 One library to rule all charts for React Native 📊
MIT License
2.35k stars 399 forks source link

[Feature] Update react-native-svg dependency version #531

Open hmm210197 opened 3 years ago

hmm210197 commented 3 years ago

Description of feature

As title, it is necessary to update this dependency. Because my project install the newest version of react native svg and react native svg charts not working.

hraschan commented 3 years ago

Got the same issue! Please update the react-native-svg version. It should be super easy i guess. :)

mauritsbecks commented 2 years ago

After updating to the latest version of react-native-svg (12.1.1), npm doesn't allow me to install react-native-svg-charts. npm install react-native-svg-charts will give me the following error:

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: app@0.0.1 npm ERR! Found: react-native-svg@12.1.1 npm ERR! node_modules/react-native-svg npm ERR! react-native-svg@"^12.1.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react-native-svg@"^6.2.1||^7.0.3" from react-native-svg-charts@5.4.0 npm ERR! node_modules/react-native-svg-charts npm ERR! react-native-svg-charts@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See \npm-cache\eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! \npm-cache_logs\2021-11-19T12_58_50_303Z-debug.log

Is there a way to fix this dependency conflict?

UPDATE: I first uninstalled react-native-svg with npm uninstall react-native-svg and reinstalled it with npm i react-native-svg@7.0.3 to match the required version. This solved the dependency conflict.

UVStudio commented 2 years ago

I'm also having this issue with react-native-svg 12.1.1 and react-native-svg-charts 5.4 at this point in time (January 2022). Strange thing is, I installed these two modules late in 2020 for a project back then and it didn't give me problems. That app is still working fine. But trying to install these modules now is giving me the same error as @mauritsbecks .

Any updates or insights?

EDIT: I should mention that both my apps are on Expo 42

mauritsbecks commented 2 years ago

@UVStudio my solution was to first uninstall the latest version of react-native-svg with npm uninstall react-native-svg. Subsequently reinstalling react-native-svg, version 7.0.3, with npm i react-native-svg@7.0.3 to match the required version. This solved the dependency conflict. Good luck.

UVStudio commented 2 years ago

@mauritsbecks Thanks for the reply. I should've also mentioned that the react-native-svg 7.0.3 solution didn't work for me. Got the same imageSourceProp error as the last comment in this thread: https://github.com/JesperLekland/react-native-svg-charts/issues/548

EDIT: Trying to install expo-chart-kit is giving me the same error: peer react-native-svg@"^6.4.1" from expo-chart-kit@1.2.4 Also, tried installing expo-chart-kit in my old project from 2020 is also giving me the same error.

EDIT TWO: npm i react-native-svg-charts --legacy-peer-deps seems to be working.

Daniel528 commented 2 years ago

I've spent a few hours today going around in circles figuring this out. I am unsure why but using npm to install react-native-svg-charts will throw the dependancy tree error if you're using newer versions of react-native-svg (we were using v12) however yarn does not throw a dependancy error. So yarn add react-native-svg-charts will install react-native-svg-charts regardless of react-native-svg version (idk if yarn just ignores dependancy errors or what). It seems, although it throws a dependancy error, react-native-svg-charts (in my use of it) with react-native-svg v12.1.1 does not break. It still functions fine. So theoretically using the --legacy-peer-deps or --force flags on your npm install of react-native-svg-charts will still install everything and it will be in working order. Alternatively install react-native-svg-charts module using yarn.

UVStudio commented 2 years ago

Thank you @Daniel528. I had to eject out of expo for some other reason and this issue was causing me trouble ejecting. I had to remove both react-native-svg and react-native-svg-charts modules first before I managed to successfully eject. Finally got a chance to come back to this thread and your tip got my app working. I get the same warning message as you did but like you said, it still works.

yahacom commented 2 years ago

Same problem here. Off course we can use react-native-svg@7.0.3 but it outdated a bit and unsupport few needed features on my project. So I need one of newer versions of RN SVG. Currently I use 12.1.0 and have same troubles with installing svg-charts as described above. Do anyone familiar with svg-charts can look into and update this dependency?

anwersolangi commented 2 years ago

What if we change this line https://github.com/JesperLekland/react-native-svg-charts/blob/d840ebe34ca11a9132c84a58e0614fccd773e92e/package.json#L60 to the latest version of the svg? because this is the peerDependancy line which is throwing error.

MobileMon commented 1 year ago

a temporary solution is to install using:

npm install --save react-native-svg-charts --force

again, its temporary and may have issues but its working for me until this library gets updated

LucasPereiira commented 1 year ago

a temporary solution is to install using:

npm install --save react-native-svg-charts --force

again, its temporary and may have issues but its working for me until this library gets updated

This working for me too. But, when build APK, the problem return. Just work in emulator

mjewell commented 1 year ago

Using force / legacy-peer-deps was causing issues on subsequent installs, but I was able to fix this permanently by moving react-native-svg from dependencies to overrides in package.json

  "overrides": {
    "react-native-svg": "13.8.0"
  },

If you're using yarn the equivalent field is resolutions

CMLCNL commented 1 year ago

any update here for this issue?

danharten-sovtech commented 9 months ago

Don't think you'll get an update @CMLCNL, there has been no maintenance in 4 years.

talbertherndon commented 7 months ago

After updating to the latest version of react-native-svg (12.1.1), npm doesn't allow me to install react-native-svg-charts. npm install react-native-svg-charts will give me the following error:

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: app@0.0.1 npm ERR! Found: react-native-svg@12.1.1 npm ERR! node_modules/react-native-svg npm ERR! react-native-svg@"^12.1.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react-native-svg@"^6.2.1||^7.0.3" from react-native-svg-charts@5.4.0 npm ERR! node_modules/react-native-svg-charts npm ERR! react-native-svg-charts@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See \npm-cache\eresolve-report.txt for a full report. npm ERR! A complete log of this run can be found in: npm ERR! \npm-cache_logs\2021-11-19T12_58_50_303Z-debug.log

Is there a way to fix this dependency conflict?

UPDATE: I first uninstalled react-native-svg with npm uninstall react-native-svg and reinstalled it with npm i react-native-svg@7.0.3 to match the required version. This solved the dependency conflict.

Try using react-native-svg 12.3.0 and react-native-svg-charts 5.4.0

The older versions don't work