React-native-windows: Fatal Crash (Error HRESULT E_FAIL has been returned from a call to a COM component) in RN 0.59.0-rc.1 after upgrade from RN 0.57

Created on 7 Aug 2019  路  6Comments  路  Source: microsoft/react-native-windows

Environment

  1. react-native -v: react-native-cli: 2.0.1, react-native: 0.59.10
  2. npm ls rnpm-plugin-windows: [email protected]
  3. npm ls react-native-windows: [email protected]
  4. node -v: 10.0.16299.0
  5. npm -v: 6.7.0
  6. yarn --version: 1.15.2

Then, specify:

  • Target Platform: UWP

  • Target Platform Version(s): 10.0.17134.0 (min: 10.0.16299.0)

  • Target Device(s): Desktop

  • Development Operating System: Windows Build 17763

  • Visual Studio Version: Visual Studio 2017

  • Build Configuration: Debug x86

Steps to Reproduce

  1. Build and Run the App
  2. Wait for the js bundle to be loaded from the packager

Expected Behavior

The Root React Component should be rendered.

Actual Behavior

The app crashes with the following error:

[Critical] [RNW] Exception caught in top handler
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
   at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
   at ReactNative.Views.Text.ReactSimpleTextShadowNode.MeasureText(ReactSimpleTextShadowNode textNode, YogaNode node, Single width, YogaMeasureMode widthMode, Single height, YogaMeasureMode heightMode)
   at ReactNative.Views.Text.ReactSimpleTextShadowNode.<.ctor>b__10_0(YogaNode node, Single width, YogaMeasureMode widthMode, Single height, YogaMeasureMode heightMode)
   at Facebook.Yoga.YogaNode.MeasureInternal(IntPtr unmanagedNodePtr, Single width, YogaMeasureMode widthMode, Single height, YogaMeasureMode heightMode)
   at Facebook.Yoga.Native.YGNodeCalculateLayout(YGNodeHandle node, Single availableWidth, Single availableHeight, YogaDirection parentDirection)
   at Facebook.Yoga.YogaNode.CalculateLayout(Single width, Single height)
   at ReactNative.UIManager.ReactShadowNode.CalculateLayout()
   at ReactNative.UIManager.UIImplementation.CalculateRootLayout(ReactShadowNode cssRoot)
   at ReactNative.UIManager.UIImplementation.UpdateViewHierarchy()
   at ReactNative.UIManager.UIImplementation.DispatchViewUpdates(Int32 batchId)
   at ReactNative.UIManager.UIManagerModule.OnBatchComplete()
   at ReactNative.Bridge.Queue.ActionQueue.OnNext(Action action)

issue

.NET

Most helpful comment

Same error here. I have made some tests and this error happens when a Text node is inside a ScrollView. When MeasureText is called, the height of Text is NaN.

All 6 comments

@rozele - can you take a look at this.

Same error here. I have made some tests and this error happens when a Text node is inside a ScrollView. When MeasureText is called, the height of Text is NaN.

This error is affecting us as well and is stopping us being able to finish our upgrade to RN0.59.

I have created a simple repo of the error here

So, to clarify, this only happens when Text is embedded in a ScrollView? Strange that this doesn't repro in RNTester (which has Text in a ScrollView). Looking now.

Please run:

yarn add [email protected]

or...

npm i --save [email protected]

And confirm if the issue with text is resolved. It looks like the wrong Yoga submodule was published in rc.1.

@rozele I can confirm that I have been able to get our app up and running again using the new rc.3 version

Was this page helpful?
0 / 5 - 0 ratings