victory icon indicating copy to clipboard operation
victory copied to clipboard

Random crashes by react-native-svg

Open LucasHimelfarb opened this issue 10 months ago • 12 comments

Describe the bug In my implementation of victory-native I got many and random crashes. I think this error happens because I have react-native-svg latest version installed on my app. I can't downgrade react-native-svg to 12.4.3 (used in this project) because thats broke others things with svg.

Victory version 36.6.0

Expected behavior Overrides victory-native with fixed version of react-native-svg

Screenshots image-20230919-130219

Smartphone (please complete the following information):

  • Device: Motorola Edge 30 ULTRA
  • OS: Android 13

LucasHimelfarb avatar Sep 26 '23 20:09 LucasHimelfarb

My experience so far with Victory charts on React Native is that it is quite fragile on Android. This PathParser crash looks identical to one we were just having on our project. It's hard to make any guesses as to why this is happening to you without a seeing the chart implementation, but in our case it turned out that it was stemming from the cornerRadius property on a <VictoryBar>. We were dynamically calculating the radius based on the bar width, and in scenarios where the calculated value had a lot of decimal places that's when we'd see the crash. As stupid as it sounds, placing Math.round() around the cornerRadius value fixed it.

This almost certainly is completely unrelated to your issue, but may serve as an example of the weird ways in which Victory can crash Android.

kevtronkrueger avatar Oct 13 '23 16:10 kevtronkrueger

@kevtronkrueger Thank you very much for your contribution! I will try to replicate the error with decimal data. At least now I have a clue as to what it might be. In my case, it happens with a natural line graph

LucasHimelfarb avatar Oct 20 '23 13:10 LucasHimelfarb

@kevtronkrueger in my implementation I don't have props with decimal values ​​except the data prop. Maybe that error comes from my data, do you know if that is possible?

LucasHimelfarb avatar Oct 20 '23 14:10 LucasHimelfarb

Hi everyone, we are transitioning all Native development to our new Victory Native XL library which is purpose built for supporting Native. Many of the design decisions we made in this version of Victory is not ideal for Native development.

carbonrobot avatar Nov 17 '23 20:11 carbonrobot

any solutions for this issue?

amit13091992 avatar Dec 08 '23 12:12 amit13091992

@carbonrobot with both Victory and Victory XL, we still experience a lot of rendering issues when displaying more than a signle line chart in a view. after rendering 2 line charts even with on one line and a dozen datapoint each per chart it produces broken renders victory and victoryXL, it seems like most ohter charting libraries we've tried have this problem.

rendering less than 3 line charts is perfecto, instances after that are all broken renders with no error output. Would love an documented example where multiple charts are showing in a single view with no issues.

daniel-ricado avatar Feb 23 '24 00:02 daniel-ricado

@daniel-ricado Thanks for the update, do you have a small example or reproduction steps we can work from? Is it specific to iOS, Android, mobile browsers?

We have some apps for clients that use dozens of charts on the same view, so I want to make sure we are testing your specific use case and addressing it.

carbonrobot avatar Feb 23 '24 13:02 carbonrobot

@daniel-ricado I'm looking into this on the Victory Native XL side, and so far I'm unable to replicate what you described when adding multiple line charts in a single view.

For the issues you're experiencing with Victory Native XL specifically, could you please create a new issue on that project with example code snippet and reproduction steps so we can more easily investigate on our end? Thanks!

masiddee avatar Feb 26 '24 16:02 masiddee

@carbonrobot @masiddee

thanks for your quick replies, was working on the reproducable example and found that it was due to the parent container using flex: 1 to stretch the View, a frustrating bug it was.

but have been tricked into a false positive before. if I get the mvp consistantly reproducing will post again.

It was also a little difficult to share given codesandbox uses react-native-web. Whats the strategy on sharing RN projects for issues like this?

daniel-ricado avatar Feb 26 '24 19:02 daniel-ricado

Thanks for confirming @daniel-ricado! Do let us know.

And we're working on using Expo Snack to share code snippets, but so far have been unsuccessful at getting VNXL and its dependencies up and running. Until then, if you can just share the relevant bits of code in your issue description, and describe what you're trying to do, that should be sufficient.

masiddee avatar Feb 28 '24 16:02 masiddee

This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] avatar May 29 '24 00:05 github-actions[bot]

@masiddee unfortunately we never got past this and ended opting for victory XL which solved most issues automatically, it is unfortunately still an early release and doesn't support as much as most will need it to.

daniel-ricado avatar May 29 '24 01:05 daniel-ricado