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.

Too few elements in array (expected at least 5)

See original GitHub issue

In the latest rnsvg (9.2.4), I get this error. Tracing the error, it appears that the RNSVGCGColor function expects an array of 5+ elements for the color, but the extractBrush (extractColor) function returns an array of length 2.

For example, if I provide a stroke color (stroke: "rgba(0, 0, 0, 0.3)"), the extractBrush returns [0, 1291845632], leading to the below screenshot.

simulator screen shot - iphone x - 2019-02-12 at 10 57 53

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21

github_iconTop GitHub Comments

4reactions
dwiltcommented, Mar 29, 2019

For those of you who can upgrade (not using Expo), the only full proof way for us that worked was following these exact steps:

  1. Close Xcode
  2. Delete app from phone
  3. Re-clone the repo (I said it would work - not be short and sweet)
  4. Run yarn; cd ios; pod install --repo-update; cd ..; npm run start -- --reset-cache in root of project
  5. Open project in Xcode (remember to open the .xcworkspace and NOT the .xcodeproj)
  6. Clean (cmd-shift-k)
  7. Build (cmd-r)
  8. Pray to Xcode
  9. Celebrate
4reactions
msandcommented, Feb 13, 2019

Can you open the project in xcode, clean the build, and build again? Seems your native code didn’t update

Read more comments on GitHub >

github_iconTop Results From Across the Web

Too few elements in array (expected at least 5) #932 - GitHub
In the latest rnsvg (9.2.4), I get this error. Tracing the error, it appears that the RNSVGCGColor function expects an array of 5+...
Read more >
What will happen if you put too few elements in an array when ...
There is no such thing as putting too few elements in an array. When you create an empty array you can fill up...
Read more >
How can I get the next few elements in an array but jump back ...
Now I want to get the next for instance 3 elements after "el5" (index 4). As you can see there are only 2...
Read more >
Array.prototype.pop() - JavaScript - MDN Web Docs
The pop() method removes the last element from an array and returns that element. This method changes the length of the array.
Read more >
Find the largest three distinct elements in an array
Expected time complexity is O(n) and extra space is O(1). Examples : Input: arr[] = {10, 4, 3, 50, 23, 90} Output: 90,...
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