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] JS confirm causes a native crash

See original GitHub issue

Bug description:

Out of the blue, using confirm("test") in a webview will raise the following native exception:

2020-08-21 12:36:59.614662-0300 zinspector3[4620:1558927] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Completion handler passed to -[RNCWebView webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:] was not called'
*** First throw call stack:
(0x189435654 0x189157bcc 0x18932ba58 0x190ac0674 0x190b3a24c 0x190bb8ec8 0x189023a4c 0x102972b30 0x189023a4c 0x18cb11afc 0x18cb0fca8 0x18917404c 0x189173f44 0x1982c844c 0x1982f5d7c 0x1893b3ad8 0x1893b3a30 0x1893b31b8 0x1893ae1e8 0x1893adba8 0x19351d344 0x18d4e93e4 0x1029706e8 0x1892358f0)
libc++abi.dylib: terminating with uncaught exception of type NSException

I have downgraded to 10.4.0 and the issue does not happen, I suspect the following PRs may have introduced the bug since it happens with 10.4.1 and 10.4.2, up until 10.7.0: https://github.com/react-native-community/react-native-webview/pull/1567

To Reproduce:

confirm("Hi") in any webview.

Expected behavior:

No crash

Screenshots/Videos:

Environment:

  • OS: iOS
  • OS version: any version > 10
  • react-native version: 0.62.2
  • react-native-webview version: 10.4.1 to 10.7.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
cristianoccazinspcommented, Aug 25, 2020

@jxm2004 I have just reproduced your alert crash if the && check is not used, so I see what you’re talking about.

I have also tried using RCTPresentedViewController() and removed all the redundant recursive calls and the crash is gone, and also my own issue with the modal is gone… I don’t know what else could be tried to make sure this change is appropriate, but would definitely make the code much more readable.

1reaction
react-native-community-botcommented, Aug 25, 2020

🎉 This issue has been resolved in version 10.8.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash if not in debug on android and iOS - Stack Overflow
It looks like you are using a regular expression somewhere in your code and have passed it an invalid character. Are you using...
Read more >
React Native App crashing on ios 15.4.1 - Apple Developer
1. Hello Apple Team, We are facing bunch of Crashes with our app especially on OS - 15.4.
Read more >
Troubleshooting build errors and crashes - Expo Documentation
A reference for troubleshooting build errors and crashes when using EAS Build. ... is to determine if the build failed due to a...
Read more >
React Native: How to Fix IOS App Crashes
How we Solved this Issue? · Navigate to Xcode->Window->Devices and Simulators open it. · Attach your iPhone with Mac machine. · Select your...
Read more >
Get started with Firebase Crashlytics - Google
If you've refreshed the console and you're still not seeing the test crash after five minutes, enable debug logging to see if your...
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