Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Crash: [nullthrows] "Got unexpected undefined" in UIManager.measureInWindow #41730

Closed
jgillick opened this issue Nov 30, 2023 · 4 comments
Closed
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍 Newer Patch Available Platform: iOS iOS applications.

Comments

@jgillick
Copy link

Description

I am seeing app crash reports on iOS with the error:

Got unexpected undefined

The stacktrace shows that it comes from this line in UIManager.measureInWindow:
https://github.com/facebook/react-native/blob/v0.72.6/packages/react-native/Libraries/ReactNative/UIManager.js#L88

This implies that the method getFabricUIManager() returns undefined.

My app has fabric disabled.

Full stack track:

Error Got unexpected undefined 
    Users/runner/work/together/together/packages/dating-app/node_modules/nullthrows/nullthrows.js:7:23 nullthrows
    Users/runner/work/together/together/packages/dating-app/node_modules/react-native/Libraries/ReactNative/UIManager.js:88:40 measureInWindow
    Users/runner/work/together/together/packages/dating-app/node_modules/@ui-kitten/components/devsupport/components/measure/measure.component.js:60:48 measureSelf
    Users/runner/work/together/together/packages/dating-app/node_modules/@ui-kitten/components/devsupport/components/measure/measure.component.js:50:23 onUIManagerMeasure
    (native) apply
    Users/runner/work/together/together/packages/dating-app/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:474:12 __invokeCallback
    Users/runner/work/together/together/packages/dating-app/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:124:27 anonymous
    Users/runner/work/together/together/packages/dating-app/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:368:10 __guard
    Users/runner/work/together/together/packages/dating-app/node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:123:16 invokeCallbackAndReturnFlushedQueue

Interestingly, the main branch looks like it might not be much better. nativeFabricUIManagerProxy seems to be initialized to undefined (see code), however, the code will only define a value for it if it is null. (see code). However, I could be misreading ithis.

React Native Version

0.71.6

Output of npx react-native info

System:
OS: macOS 14.1.1
CPU: (8) arm64 Apple M2
Memory: 194.55 MB / 24.00 GB
Shell:
version: 3.6.1
path: /opt/homebrew/bin/fish
Binaries:
Node:
version: 18.18.2
path: /usr/local/bin/node
Yarn:
version: 3.6.1
path: /usr/local/bin/yarn
npm:
version: 9.8.1
path: /usr/local/bin/npm
Watchman:
version: 2023.10.09.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.13.0
path: /Users/jeremy/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.0
- iOS 17.0
- macOS 14.0
- tvOS 17.0
- watchOS 10.0
Android SDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10811636
Xcode:
version: 15.0.1/15A507
path: /usr/bin/xcodebuild
Languages:
Java:
version: 16.0.1
path: /usr/bin/javac
Ruby:
version: 3.2.2
path: /Users/jeremy/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.6
wanted: 0.72.6
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Steps to reproduce

I have not been able to reproduce it directly and am just going by the stack traces from the crash reports.

Snack, screenshot, or link to a repository

Unfortunately, I have not been able to create a reproduction directly.

@github-actions github-actions bot added the Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. label Nov 30, 2023
Copy link

⚠️ Missing Reproducible Example
ℹ️ 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/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

Copy link

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - 0.71.14. 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.

@github-actions github-actions bot added the Platform: iOS iOS applications. label Nov 30, 2023
@cortinico
Copy link
Contributor

Unfortunately, I have not been able to create a reproduction directly.

Without a repro we can't really help

@jgillick
Copy link
Author

jgillick commented Dec 1, 2023

After further investigation, it looks like the library which calls measureInWindow (UI Kitten) already has a proposed fix (akveo/react-native-ui-kitten#1790) on their end. So I'm closing this issue.

@jgillick jgillick closed this as completed Dec 1, 2023
@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Needs: Triage 🔍 Newer Patch Available Platform: iOS iOS applications.
Projects
None yet
Development

No branches or pull requests

2 participants