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] React Native stack trace does not show JS lines #248

Closed
esam091 opened this issue Feb 27, 2018 · 40 comments
Closed

[iOS] React Native stack trace does not show JS lines #248

esam091 opened this issue Feb 27, 2018 · 40 comments
Labels

Comments

@esam091
Copy link

esam091 commented Feb 27, 2018

I have an existing app that I want to integrate with Crashes SDK, but after following the instructions, the JS stack trace is still not showing.

This is what I got from the report instead
screen shot 2018-02-27 at 10 25 41

On the other hand, when I tried the SDK with a dummy app, it works perfectly, showing the correct stack trace of the JS crash.
screen shot 2018-02-27 at 10 33 12

The stack trace stops on RCTAssert.m if I forgot to upload the bundle along with the dSYM.
screen shot 2018-02-27 at 10 36 03

  1. What do I need to do to make it work in my app?
  2. How do you guys decide when to show JS stack trace instead of native ones?
    Assuming that the crash reporter needs to land on RCTAssert.m for it to work properly, I have additional information that might help. When using Crashlytics, the crash report lands correctly on RCTAssert.m.
    I've also uninstalled Crashlytics to make sure the two crash reporters don't conflict.
@guperrot
Copy link
Member

The first crash is not Javascript. Something wrong happened in Facebook native code and their native module threw an objective C exception, not javascript.

Our SDK also handles objective C exceptions and they look different.

@esam091
Copy link
Author

esam091 commented Feb 28, 2018

Thanks for replying. Is there anything that I can do to figure out the problem?

@guperrot
Copy link
Member

This is all the information we got, you can probably get the RAW tab details of an individual occurrence and create a bug against React Native repository as they are probably causing the issue.

@guperrot
Copy link
Member

guperrot commented Mar 3, 2018

Hey!

We haven't heard from you in a while, so I am going to go ahead and close this conversation. Should you still have any questions, please don't hesitate to contact us again.

Thanks for using App Center!

@guperrot guperrot closed this as completed Mar 3, 2018
@mmiani
Copy link
Contributor

mmiani commented Jul 4, 2018

I'm having kind of the same issue, I'm not able to see the JS stack trace.
This is the exception backtrace generated by the following JS crash:

throw new Error('This is a test javascript crash!');

screen shot 2018-07-04 at 8 00 18 pm

@mattslight
Copy link

@guperrot I have the same issue. i do:

Crashes.setListener({ shouldProcess: true })
throw Error('test error')

And I only see the Objective-C trace. Showing RCTAssert.m line 132.

I also specified send Javascript crashes at react-native link

@guperrot
Copy link
Member

guperrot commented Nov 30, 2018

@mmiani @mattslight the SDK does not do anything special regarding symbolication, it all happens on server side with uploaded symbols that contain the source map. If you already made sure you uploaded symbols containing the javascript source map as documented in https://docs.microsoft.com/en-us/appcenter/diagnostics/symbolication#uploading-symbols and it's not working for you, then please open a support ticket from any page of https://appcenter.ms and describe the problem, preferably download the json report file from a single occurrence of the crash and share it with support engineers there.

Also shouldProcess is a function that returns a boolean, not a just a boolean.

@syntax-e
Copy link

syntax-e commented Oct 8, 2019

Somehow our app ended up in this state as well. I believe it happened after updating to RN 59.10

@Jamminroot
Copy link

@harrisonschwartz can you check whether updating RN version fixes the problem? As per @guperrot's comment it looks like RN problem, and not SDK.

@sarmad1995
Copy link

Same issue, can't see what is the real problem here.
I am also using codepush with my app, maybe that must have some issue?

@annakocheshkova
Copy link

@sarmad1995 I don't think it should. Have you managed to try the suggestions above?

@caisd1998
Copy link

Same problem. I think this feature is down for new version of react native.
I created a react native app with initial template (version 0.60.5), and then add two buttons to trigger javascript and native crashes according to this document in appcenter.
I then used appcenter to build this app to iOS app, both javascript and native crashes are reported correctly with native stack trace, while javascript crash's javascript stack trace didn't show the line.
I'm contacting support to take a look.

@russelarms
Copy link
Contributor

@caisd1998 have you uploaded index.ios.map file in the same .zip file according to this paragraph?

@caisd1998
Copy link

@russelarms There is no need to upload source map or symbol files, because I'm building within appcenter, it has been taken care of, see the top part of the document you mentioned:

The App Center Build and Distribution service can automatically generate a valid dSYM and source map .zip file and upload the file to the Diagnostics service. If you use App Center to build and auto distribute your app to your end users, you don't need to manually obtain and upload the symbol files as detailed in the steps below.

@caisd1998
Copy link

This is the reported crash:
Screen Shot 2019-12-26 at 13 52 29

This is the source code.

@russelarms russelarms reopened this Dec 30, 2019
@victorkvarghese
Copy link

Anyone found a solution?? I'm facing the same issue. I'm using appcenter to build and deploy the app

@caisd1998
Copy link

Anyone found a solution?? I'm facing the same issue. I'm using appcenter to build and deploy the app

There's nothing we can do. I've contacted with App Center support, and he confirmed this issue, just that is tracked as an internal bug, don't know when this can be fixed...

@MrTact
Copy link

MrTact commented Feb 5, 2020

I spent a bit of time on this recently as it is affecting my team as well. The most interesting and perhaps useful piece of information was that crashes inside the render loop seem to get their JS stack trace uploaded successfully. Crashes in response to e.g. an event handler callback (outside the render loop) do create a JS stack trace in the .plcrash file, which is textually subtly different than the render loop crash, but the JS portion of the crash dump (appended to "additional info") doesn't show up after it is uploaded. I haven't been able to figure out why; inspecting the structure of the exception that gets thrown by each of these cases doesn't show any discernable difference, and for obvious reasons it's really hard to debug the actual crash dump part of the process.

@MrTact
Copy link

MrTact commented Feb 5, 2020

Should also probably mention microsoft/appcenter#857 might be related.

@caisd1998
Copy link

Here is the response from app center support:

Minor update here: the work item is being reviewed and finalized.
You can track this with those PRs:
microsoft/appcenter-sdk-apple#1959
#798
Once those merged, the next release (the one after the merge) should contain fix for your problem.

@victorkvarghese
Copy link

Did these commits helped anyone? I'm still not able to get JS lines in stacktrace.
I even created a new app and tried..

@MatkovIvan
Copy link
Contributor

@victorkvarghese The fix isn't released yet, it will be included to the next version

@victorkvarghese
Copy link

victorkvarghese commented Feb 19, 2020 via email

@MatkovIvan
Copy link
Contributor

Before the end of this month, most likely in the next couple of days.

@patman1
Copy link

patman1 commented Feb 19, 2020

Is this iOS specific? I'm experiencing the same issue on React Native Android.

@russelarms
Copy link
Contributor

russelarms commented Feb 20, 2020

@patman1, unfortunately, we don't have support for JS stack traces on Android yet.
You can track and vote here to support the feature request: microsoft/appcenter#75

@patman1
Copy link

patman1 commented Feb 20, 2020

This unbelievable feature gap deserves at least mention in official setup docs
https://docs.microsoft.com/en-us/appcenter/sdk/crashes/react-native it would save some time.

@guperrot guperrot added bug and removed support labels Feb 24, 2020
@guperrot
Copy link
Member

The new version of the SDK has been released with a fix: 3.0.0.

@guperrot
Copy link
Member

guperrot commented Feb 24, 2020

This is the related changelog entry in core module that was responsible for this bug (it was not a bug in crashes module itself):

[Fix] Fix an issue where React Native SDK would not send wrapperSdk information.

@victorkvarghese
Copy link

victorkvarghese commented Feb 25, 2020

Please reopen this thread..
Updated to 3.0.0, Disabled bitcode, Symbols are uploaded automatically via appcenter.

Still the same issue. I'm in contact with appcenter team for almost one month now..

Screenshot 2020-02-25 at 9 23 54 PM

PS: it's not an unsymbolised error.

@Jamminroot Jamminroot reopened this Feb 25, 2020
@Jamminroot
Copy link

@victorkvarghese can that be reproduced on new, fresh project, or is it only after update?

@victorkvarghese
Copy link

@Jamminroot i was having these issue on old version and the latest ones as well

@Jamminroot
Copy link

@victorkvarghese ok, and can it be reproduced on clean project? When you just create new project, add SDK, and try running few pieces of code? Or does it only occur after update to newer version?

@Jamminroot
Copy link

Also, have you, by any chance, ran react-native bundle --entry-file index.ios.js --platform ios --dev false --reset-cache --bundle-output unused.jsbundle --sourcemap-output index.ios.map as per documentation?

@victorkvarghese
Copy link

victorkvarghese commented Feb 27, 2020

@Jamminroot I diged deep to crash reports the sdkVersion: 2.5.3 not 3.0.0.
I did upgrade the app by replacing versions in package.json and re running pod install.

But not sure why sdkversions are still 2.5.3 in crash reports. still looking into that
After pod install

 - appcenter-core (3.0.0):
     - AppCenterReactNativeShared
     - React
   - AppCenter/Core (2.5.3)
   - AppCenterReactNativeShared (2.6.1):
     - AppCenter/Core (= 2.5.3)

@russelarms
Copy link
Contributor

@victorkvarghese

I did upgrade the app by replacing versions in package.json and re-running pod install.

Have you run npm i or yarn install after that?

You can also try to run pod install --repo-update instead of pod install.

@victorkvarghese
Copy link

victorkvarghese commented Feb 27, 2020

@russelarms Thnaks its worked. Able to update to 3.0.0

@Jamminroot @guperrot Updating to latest version solved the issue for me. You can close the issue now.

Thanks a lot guys..

@victorkvarghese
Copy link

Screenshot (18)

@Jamminroot
Copy link

Glad it worked.
Have a nice day!

@glacjay
Copy link

glacjay commented Jun 15, 2022

There is another hint: DON'T add --minify false to your react-native command, as it will break appcenter's parsing of JS stacetrace.

It had bothered me for a looooong time. Hope it's helpful to someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests