react-native -v
: 0.55.0npm ls rnpm-plugin-windows
: 0.2.8npm ls react-native-windows
: 0.55.0-rc.0Then, specify:
Target Platform: UWP
Target Platform Version(s): UWP
Target Device(s): Surface
Development Operating System: Windows
Visual Studio Version: 2017
Upgrading from an earlier version, 0.47.0 to the now stable 0.55.0, the following error has occurred when I click on a component:
Shadow Node for Tag Does Not Exist
However, if I dismiss the RedBox in debug mode, I am then able to click on the Component again like it is supposed to work.
No Shadow Node for Tag Does Not Exist when I click on a Component
This only happens on my windows code and not on iOS - I will try to get a demo project together, but it deals with a FlatList and adding an item to the list. Regardless of what that item is, it could be a Text
component, just touching the item causes the error. The item doesn't even need to be touchable or have an onPress listener
More detailed information - Using a ListView
in place of the FlatList
component fixes this problem. Its hard for me to get a reproducible demo but as I mentioned it involves:
FlatList
ComponentFlatList
@jpshelley have you tried to repro on Android? Android and Windows share a similar UIManager architecture.
@rozele double checked and not happening on Android. I'll try to create a demo project this week sometime to help diagnose the issue.
I did more digging and the above was false - I now think its because of a custom Modal
component. We've attempted something similar to https://github.com/Microsoft/react-native-windows/issues/618 in our code base to use the Modal
component. As soon as that modal is dismissed, if I click in the Component that contains the FlatList
or ListView
it produces the crash.
If remove the modal logic it performs fine.
Sorry for the barrage of comments, but I want to make sure I'm adding additional info as I find it:
DispatchEvent
in TouchHandler
and continue through, everything works fine with no crashes, https://github.com/Microsoft/react-native-windows/blob/master/ReactWindows/ReactNative/Touch/TouchHandler.cs#L263This makes me think there is a threading issue with updating the shadow nodes?
I'm experiencing this as well.
Though it happens only in one single case for me:
I made a tagging component, If I add a new tag and navigate away from the view this error occurs.
Removing tags works fine.
I'll try to create a repro project
Edit: Haven't come around yet, will try this week!
Edit2: Working on repro repo now. Have to continue tomorrow as I just have a mac at home
@jpshelley @rozele So, I finally finished creating the reproduction repository: https://github.com/creambyemute/RNWindowsShadowNodeReproduction
How to reproduce:
This didn't happen in 0.53 or 0.54 if I remember correctly.
Works fine on iOS/Android
@creambyemute Thanks for the reproducable demo! I have been struggling in my React Native for WPF project with the same issue, but it was seldom and seemed random. I could never get it to happen when I wanted to dig into the problem.
Using your demo, as a quick workaround to the problem, I added a try catch around this bit of core code (found in .\node_modules\react-native-windows\ReactWindows\ReactNative.Shared\UIManager) and it seems to ignore the error without crashing.
It looks like not much progress has been made in general (releases, updates, etc) on this React Native for Windows project in a while. I wonder if this project is dying or dead? I hope not.
@jayfar I also hope not.
And great finding, thx!
We are not investing in new features or lower priority bug fixes on vCurrent. The bulk of investment is now in vNext as we prepare to make that the default choice. If this issue is still relevant on the vNext implementation please open a vNext issue. If this issue is of significant severity for a vCurrent app and vNext is not an option, re-open with justification.
Most helpful comment
@jpshelley @rozele So, I finally finished creating the reproduction repository: https://github.com/creambyemute/RNWindowsShadowNodeReproduction
How to reproduce:
This didn't happen in 0.53 or 0.54 if I remember correctly.
Works fine on iOS/Android