react-native
react-native copied to clipboard
Yoga Layout Assertion Failure After Upgrading to React Native 0.78
Description
After updating to React Native version 0.78, I encountered an assertion failure related to the Yoga layout engine. The error message displayed is:
Attempt to get layout metrics from dirtied Yoga node.
React Native 0.78
- OS: Windows
- Device/Emulator: Nothing 2a & Pixel Fold
- Node Version: 21.1.9
- NPM/Yarn Version: 10.20
Steps to reproduce
- Create a new React Native project using version 0.78.
- Implement a nested inline view component.
- Trigger a state update using setState() within the component.
- Observe the assertion failure in the console.
React Native Version
0.78.0
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: Windows 11 10.0.26100
CPU: "(16) x64 AMD Ryzen 7 5700G with Radeon Graphics "
Memory: 4.73 GB / 15.35 GB
Binaries:
Node:
version: 22.13.0
path: C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm:
version: 11.1.0
path: C:\Program Files\nodejs\npm.CMD
Watchman:
version: 20250113.015429.0
path: C:\ProgramData\chocolatey\bin\watchman.EXE
SDKs:
Android SDK:
API Levels:
- "35"
Build Tools:
- 34.0.0
- 35.0.0
- 35.0.1
System Images:
- android-35 | Intel x86_64 Atom
- android-35 | Google APIs Intel x86_64 Atom
- android-35 | Google Play Intel x86_64 Atom
- android-35 | Google APIs ATD Intel x86_64 Atom
Android NDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
IDEs:
Android Studio: AI-242.23726.103.2422.12816248
Visual Studio: Not Found
Languages:
Java:
version: 17.0.13
path: /c/Program Files/Microsoft/jdk-17.0.13.11-hotspot/bin/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 15.1.3
wanted: ^15.1.3
react:
installed: 19.0.0
wanted: 19.0.0
react-native:
installed: 0.78.0
wanted: 0.78.0
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true
Stacktrace or Logs
Nothing in the logs when the app is crash the dev tools or not connect to device so show the error need to connect the i am using the `npx react-native log-andorid` to manage to get the logs
Reproducer
https://github.com/react-native-community/reproducer-react-native
Screenshots and Videos
[!TIP] Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.78.1. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
[!TIP] Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
[!WARNING] Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:
- If your bug is UI related: a Snack
- If your bug is build/upgrade related: a project using our Reproducer Template
- Otherwise send us a Pull Request with the RNTesterPlayground.js edited to reproduce your bug.
Moving to facebook/yoga (cc @NickGerleman)
This is related to RN integration (assertion is in RM layout ShadowNode). IIRC there was some work @lenaic did around ShadowNode update, and a new change related to node cloning which prevented this in another context that @shwanton ran into.
@lenaic should have most context.
[!WARNING] Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:
- If your bug is UI related: a Snack
- If your bug is build/upgrade related: a project using our Reproducer Template
- Otherwise send us a Pull Request with the RNTesterPlayground.js edited to reproduce your bug.
Are there any news on this? I just got 2 production crashes reported on Crashlytics:
Fatal Exception: java.lang.OutOfMemoryError
Failed to allocate a 32 byte allocation with 2569416 free bytes and 2509KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
java.util.ArrayList.iterator (ArrayList.java:1036)
com.facebook.yoga.YogaNodeJNIBase.calculateLayout (YogaNodeJNIBase.java:207)
@RameshTigeen Could you attach an implemented repro to the issue? Does this repro on RN 0.79?
same error, when i use react-native-modal-datetime-picker in react native model dialog
any update on this. i am using 0.79.4 @NickGerleman @lenaic
Similar https://github.com/facebook/react-native/issues/52349