Shopify / react-native-skia

High-performance React Native Graphics using Skia
https://shopify.github.io/react-native-skia
MIT License
6.98k stars 452 forks source link

getting the following error in an inconsistent manner: Error: text node are not supported yet #2687

Closed Dan-Berezin closed 1 month ago

Dan-Berezin commented 1 month ago

Description

I'm working on an app in iOS made with Expo and React Native. I redesigned a component with Skia Native. The component is made of the following Skia components.

<> <>

The component looks great but inconsistently triggers a blocking error with the following screen:

Image

I'm using react-native-skia 1.4.2 , expo 50.0.19, react-native 0.73.6

I tried moving the Text inside the Group component. Also this issue started with an earlier version of RN skia and I upgraded expecting that would fix it. Does anyone knows how to avoid this crash?

Version

1.4.2

Steps to reproduce

.txtrings.txt here's the failing component (rename txt as tsx).

The error is not consistent, is only triggered sometimes but it doesn't seem related to the input.

Snack, code example, screenshot, or link to a repository

rings.txt

wcandillon commented 1 month ago

As the error states, we do not support text nodes at the moment. If the code contains a text node you will get this error. This is done by the react-reconciler package. If you think there is something fishy going on, please let us know.

I use an auto formatter with eslint (https://github.com/wcandillon/eslint-config-react-native-wcandillon) and that makes the invisible text nodes (which are just spaces) quite apparent in the source code. I hope this helps.