question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS debug mode crash almost on every refresh

See original GitHub issue

Description

Refreshing the RN app causes 'NSInternalInconsistencyException', reason: 'This method must not be called before the JS thread is created.

I’ve been seeing ever since day 1 enabling screens, but it has started to become a pain in neck to debug native code with XCode thanks to this.

Screenshots

Steps To Reproduce

  1. Use screens
  2. Refresh the app (reload?)
  3. Repeat until a crash happens

The crash comes directly from RNScreens when trying to traverse scroll views. See stack trace below.

Expected behavior

No crash

Actual behavior

Crash

#3  0x000000010504d428 in -[RCTCxxBridge ensureOnJavaScriptThread:] at node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:367
#4  0x00000001050564b8 in -[RCTCxxBridge dispatchBlock:queue:] at node_modules/react-native/React/CxxBridge/RCTCxxBridge.mm:1209
#5  0x0000000105169ae8 in -[RCTEventDispatcher sendEvent:] at node_modules/react-native/React/CoreModules/RCTEventDispatcher.mm:170
#6  0x00000001050f194c in -[RCTScrollView sendScrollEventWithName:scrollView:userData:] at node_modules/react-native/React/Views/ScrollView/RCTScrollView.m:962
#7  0x00000001050ed948 in -[RCTScrollView scrollViewDidScroll:] at node_modules/react-native/React/Views/ScrollView/RCTScrollView.m:589
#8  0x00000001050ef068 in -[RCTScrollView scrollViewDidEndDecelerating:] at node_modules/react-native/React/Views/ScrollView/RCTScrollView.m:762
#9  0x0000000105008eb4 in -[RNSScreen traverseForScrollView:] at node_modules/react-native-screens/ios/RNSScreen.m:693
#10 0x0000000105008fd4 in __35-[RNSScreen traverseForScrollView:]_block_invoke at node_modules/react-native-screens/ios/RNSScreen.m:696

Reproduction

Platform

  • iOS
  • Android
  • Web
  • Windows
  • tvOS

Workflow

  • Managed workflow
  • Bare workflow

Package versions

package version
react-native 0.65.1
@react-navigation/native 5.9.4
@react-navigation/native-stack 5.14.9
react-native-screens 3.9.0
react-native-safe-area-context 3.3.2
react-native-gesture-handler 1.10.3
react-native-reanimated 1.13.2
expo -

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
cristianoccazinspcommented, Nov 18, 2021

Looks like #1217 fixes it, awesome!

0reactions
WoLewickicommented, Nov 18, 2021

Can you check if https://github.com/software-mansion/react-native-screens/pull/1217 fixes the issue? And could you provide a quick repro of the problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

web inspector disconnecting | Apple Developer Forums
1/MacOS 10.13.1 is unable to maintain a web inspector connection with a web page on Safari iOS - iPhone 6, iOS 11.1.1. Almost...
Read more >
iOS app crashing in debug mode, working in release mode
The method that crashes is recursive, and extremely!! substantial; as long as there aren't too many recursions it works fine in both debug...
Read more >
iOS 16 Problems and Bugs with Fixes in 2022 - Tenorshare
Use low power mode or enable auto-brightness or adjust display brightness to slow down battery drain. Turn off Location Services. Turn off ...
Read more >
How to Fix Crashing Apps on an iPhone or Android?
I am a developer of iPhone/Android and my app keeps crashing on users phones… ... Each brand, and model, has its own distinct...
Read more >
1004038 - Refresh while on a breakpoint devtools will remain ...
What went wrong? Seems like refreshing while on a breakpoint failed to exit the debugger, hence causing the browser to hang. ... Flash...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found