-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Crash on reportSoftException when lineNumber is missing #24382
Comments
I am getting the following error
This appears to be similar so let me know if providing more information will be helpful. |
…4399) Summary: Fixes facebook#24382 [ANDROID] [INTERNAL] - Fixed a `NoSuchKeyException` when parsing JS stack frames without line numbers. Pull Request resolved: facebook#24399 Differential Revision: D14890746 Pulled By: cpojer fbshipit-source-id: cea3653076484ad624084c370439f8a39c303083
…4399) Summary: Fixes facebook#24382 [ANDROID] [INTERNAL] - Fixed a `NoSuchKeyException` when parsing JS stack frames without line numbers. Pull Request resolved: facebook#24399 Differential Revision: D14890746 Pulled By: cpojer fbshipit-source-id: cea3653076484ad624084c370439f8a39c303083
I see that the code is same from 0.52 version of react native. Can anyone please let me know why this issue is coming up in the past week?? |
I would expect that in most of older versions the line numbers were generated correctly, but due to some recent issues like facebook/metro#380 there might be some mess with source maps that uncovered need for more defensive code here. |
Same crash for us since 5th April. We are on react-native 0.55.4. Don't know why it started and how to stop it. |
We are on react-native 0.56.0 and noticing this issue since a few days now. We will try to cherry pick that commit: Salakar@ee38bb1 to react-native 0.56.0 and build react native from source. If anyone has some experience with this, any input would be helpful. |
I also tried to build from source and am still trying to recover from that action... I'm inexperienced in react native and mobile in general and there's no documentation to help. Since installing from source, the strings “path/to/build/directory” consistently fail to get replaced, and firebase is not working. There's no documentation on undoing install from source either. Any expert advice will be great! |
I'm using react-native 0.59 and experiencing this issue |
@helloagain-dev, @tjann and @pearlismylove When exactly have you guys started facing this? |
The day after this issue was posted (6 days ago) |
For us it also started pretty much the same time the issue was posted. But only with apps that were re-built since then. |
I am getting the same issue
RN version 0.58 |
Hi everyone, We have figured it out. It started due a version bump in one of transitive dependencies of react-native i.e. stacktrace-parser. On 5th April, they released 0.1.5 and this crash started happening. I can confirm that downgrading it to 0.1.4, by specifying it in package.json, has resolved the issue for us. |
@yogeshchoudhary147 is it required to build react-native from source after specifying stacktrace-parser version 0.1.4 in package.json? |
@helloagain-dev No. This is how my package.json looks like now
|
Hi @yogeshchoudhary147
|
@thangchq-ibl If you are using npm, then delete package-lock.json and try |
i also got this issue only in release builds, happend after upgrading and downgrading react-native |
Thank you @yogeshchoudhary147 I find out way to solve this issue. I use yarn install for my project.so I use |
i got same stack trace, however in my case later i found i forget to import a module i have been using in my code, hence in production version of app , it force stopped whole android app, because in production version developer activity is disabled and it not able to show red screen with error ,as result it making whole app force stopped, its really frustrating especially in my case because the missing imported module i am talking about is only used on certain condition in our app, hence to debug this we need to visit all possible cases, however at last its best to say, always test app whole flow in developer mode before releasing in production. - lesson learned |
…4399) Summary: Fixes facebook#24382 [ANDROID] [INTERNAL] - Fixed a `NoSuchKeyException` when parsing JS stack frames without line numbers. Pull Request resolved: facebook#24399 Differential Revision: D14890746 Pulled By: cpojer fbshipit-source-id: cea3653076484ad624084c370439f8a39c303083
…4399) Summary: Fixes facebook#24382 [ANDROID] [INTERNAL] - Fixed a `NoSuchKeyException` when parsing JS stack frames without line numbers. Pull Request resolved: facebook#24399 Differential Revision: D14890746 Pulled By: cpojer fbshipit-source-id: cea3653076484ad624084c370439f8a39c303083
Hi yogeshchoudhary147 May i know how to downgrading it to 0.14 in package.json? |
I'm having this error on an Android application build , using rn 0.59.3, stacktrace-parser 0.1.6, and node 10.13.0 |
This fix was released on 0.59.5 |
We have released a version which includes the fix which was introduced in that release, and yet we are still seeing the error. We also downgraded stacktrace-parser to 0.14. We can't upgrade RN to 0.59.5 on such short notice as we are on 0.55.2 and upgrading will be a lengthy process we need to do slowly and carefully. Before we do a new release commenting out report soft exception (which would be the 5th release in a week to try and fix this), is there ever scenarios where updates on android don't completely update the underlying binary / code? |
Ok so this is kind of weird. We tracked down the bug and were able to recreate it. |
If you review stack trace from the crash report most likely it will become apparent. I would presume it's due to some conditional logic like this one: react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java Line 51 in bc6dd6b
|
Hi @arudnev thanks I guess what's unusual is it's happening in report soft exception (line 46 of that file) which doesn't seem like it should crash and almost certainly seems like should be caught by componentDidCatch
|
The error is thrown here when dev support is not enabled and ExceptionsManagerModule is trying to log a stack trace: react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/ExceptionsManagerModule.java Line 46 in 9a053fc
I presume reportSoftException is called when in your JS code you do something like console.error(error). This is just a ReactMethod on a ReactModule, so calls to reportSoftException are processed asynchronously by the bridge, exceptions in that method can not be wrapped and re-thrown back inside of sync calls to console.error, JS keeps going while Java is crashing in parallel :) So, if in componentDidCatch or in any other code your (or some 3rd-party) library calls console.error it will result into call to reportSoftException, unexpected NoSuchKeyException (only in case of certain weird stack traces) that will not be reported back to JS side and will cause app crash (unless you upgrade to more recent react or downgrade the stack parser, of course). With dev support enabled the call to console.error would result in red box, but JS code would continue execution and would get to componentDidCatch (or in componentDidCatch it would log exception via console.error, thus causing red box, but no crash). Sorry for somewhat lengthy and redundant explanation. |
I'm using React Native 0.55.3. |
@arudnev Thanks so much for clarifying, will remove any we can find. No the more info the better thanks! Edit, we don't use console.error :/ I guess it's probably in a node module somewhere. Thanks |
Attempt to fix facebook/react-native#24382 pending facebook/react-native@d7bd6cc which needs update to RN 0.59.5
* Fix: Fix crash on empty or non-numeric Manual GPS coord Move code into try-catch fixes #134 * fix: bugsnag notify instead of console.error console.error may have been causing RN crash in production * Fix: App crashes instead of handling error Attempt to fix facebook/react-native#24382 pending facebook/react-native@d7bd6cc which needs update to RN 0.59.5 * fix: Extend server start timeout On some devices server start is taking longer than 10 seconds * fix: catch server start timeout * Fix: Log photo capture error * chore(logging): Add breadcrumbs to mapeo core startup * Update bugsnag breadcrumb text * REVERSE THIS: error test * Add releaseStage to bugsnag reporting * Revert "REVERSE THIS: error test" This reverts commit 9ff0458. * Add bugsnag reporting to photo capture
@mojtaba-hajishah Did you ever find a fix? We are experiencing the same problems with RN 0.57.1, and stacktrace-parser 0.1.4. |
@Crizzooo Unfortunately no. |
Same issue is happening for RN0.59.9 and stacktrace-parser 0.1.6. |
…4399) Summary: Fixes facebook#24382 [ANDROID] [INTERNAL] - Fixed a `NoSuchKeyException` when parsing JS stack frames without line numbers. Pull Request resolved: facebook#24399 Differential Revision: D14890746 Pulled By: cpojer fbshipit-source-id: cea3653076484ad624084c370439f8a39c303083
…4399) Summary: Fixes facebook#24382 [ANDROID] [INTERNAL] - Fixed a `NoSuchKeyException` when parsing JS stack frames without line numbers. Pull Request resolved: facebook#24399 Differential Revision: D14890746 Pulled By: cpojer fbshipit-source-id: cea3653076484ad624084c370439f8a39c303083
…4399) Summary: Fixes facebook#24382 [ANDROID] [INTERNAL] - Fixed a `NoSuchKeyException` when parsing JS stack frames without line numbers. Pull Request resolved: facebook#24399 Differential Revision: D14890746 Pulled By: cpojer fbshipit-source-id: cea3653076484ad624084c370439f8a39c303083
Any solutions/alternatives for this one ? :( I'm in the same situation of using a live version |
@victorkurauchi for us the issue was actually one that should have caused a hard crash, that we found and fixed. It was a bit misleading as it is supposed to be 'report soft exception' however it was just a true typerrror type bug. However it didnt 'catch' in the componentDidCatch mechaism we have, so it was all just a bit weird tbh |
hi @SamMatthewsIsACommonName thanks for the reply. I was reading and looks like some code that triggers console.warn/console.error could lead to this crash ? |
an update that our team made without upgrading react-native: we added |
🐛 Bug Report
Android app crashes when ExceptionsManagerModule.reportSoftException is called with a stack trace that has frames without lineNumber.
The following fatal exception is logged.
When app is running in debug mode something like this can be shown in red box:
To Reproduce
Log exception via console.error with stack that has frames without line numbers.
Expected Behavior
App should not crash and exception stack trace should be formatted without line numbers similar to how it's shown in red box.
Code Example
I don't have a good code sample but it's clear that problem is in the following code, where certain fields are assumed to be always present:
react-native/ReactAndroid/src/main/java/com/facebook/react/util/JSStackTrace.java
Line 28 in 97eb53d
Environment
info
React Native Environment Info:
System:
OS: macOS 10.14.4
CPU: (8) x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
Memory: 1.31 GB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.13.0 - /usr/local/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
Android SDK:
API Levels: 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28
Build Tools: 26.0.1, 26.0.2, 27.0.0, 27.0.3, 28.0.0, 28.0.0, 28.0.2, 28.0.3, 29.0.0
System Images: android-21 | Intel x86 Atom, android-21 | Google APIs Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.3 AI-182.5107.16.33.5314842
Xcode: 10.2/10E125 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.59.4 => 0.59.4
The text was updated successfully, but these errors were encountered: