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.

JSON value '50' of type NSString cannot be converted to a YGValue

See original GitHub issue

Hi!

I’m using version 7.2.0 of react-native-svg. When doing something as simple as this: <Rect height="50" width="1640.96" fill="#acd6ea" x="-232.39" y="-289.21" /> I get the following error: JSON value ‘50’ of type NSString cannot be converted to a YGValue. Did you forget the % or pt suffix? It seems like I need to specify height and width as follows: <Rect height={50} width={1640.96} fill="#acd6ea" x="-232.39" y="-289.21" /> Is this really how it supposed to be? The readme file with instructions clearly tells that it should be a string, not and int.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:6

github_iconTop GitHub Comments

1reaction
david-cakocommented, Oct 25, 2018

I was having issues where it wasn’t converting NSString to NSFloat and NSNumber. Many hours spent, many combinations of RNSVG and victory-native (what I was using it with), clean builds all along the way, and I even bumped from react-native 0.55.4 to 0.57.3. Nothing worked.

I started screwing with the order of libraries in my xcode project and that seemed to fix it. One thing I remember doing specifically was putting libPods (as I have RNSVG installed through cocoapods) first in Linked Libraries and Frameworks.

I’d recommend if anyone is having issues with value conversion that they toy with the order RNSVG is linked, or try using/not using cocoapods for installation. I think there’s something going on where another library I’m using is stomping on RNSVG’s expected RCTConvert imports/implementation.

1reaction
tovessoncommented, Oct 22, 2018

I got it working using the Xcode legacy build system

Read more comments on GitHub >

github_iconTop Results From Across the Web

Percentage error: "JSON value of type NSString cannot be ...
Hi, Since upgrading to 0.10 with RN57, percentage values crash with the ... "JSON value of type NSString cannot be converted to a...
Read more >
Error: JSON value of type NSstring cannot be converted of a ...
Sometimes i get this error: JSON value '8%' of type NSstring cannot be converted of a YGValue. Did you forget the % or...
Read more >
iOS : JSON value of type NSString cannot be converted to a ...
... type NSString cannot be converted to a ABI38_0_0YGValue [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] iOS : JSON ...
Read more >
Fixing an error: JSON value '1' of type NSNumber cannot be ...
After having upgraded React Native to 0.62.2, it got the following error: JSON value '1' of type NSNumber cannot be converted to NSString...
Read more >
Json Value Of Type Nsstring Cannot Be Converted To A ...
I get the following error: JSON value '50' of type NSString cannot be converted to a YGValue. Did you forget the % or...
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