bugsnag-js icon indicating copy to clipboard operation
bugsnag-js copied to clipboard

A missing source map banner remains visible if stacktrace contains "Global Code"

Open ubmit opened this issue 4 years ago • 6 comments

Description

The stack trace seems fine, but I got this warning:

Source mapping failed: A source map could not be applied

Is something really not working as expected?

image

Issue

Source mapping failed: A source map could not be applied

Environment

Library versions:

[email protected] /Users/guilherme/workspace/moxy/react-native-with-moxy
├── [email protected] 
└── [email protected] 
  • cocoapods version (if any) (pod --version):

  • iOS/Android version(s): Android 10

  • simulator/emulator or physical device?: simulator

  • debug mode or production?: production

  • [ ] (iOS only) [BugsnagReactNative start] is present in the application:didFinishLaunchingWithOptions: method in your AppDelegate class?

  • [ ] (Android only) BugsnagReactNative.start(this) is present in the onCreate method of your MainApplication class? No

ubmit avatar Aug 04 '20 15:08 ubmit

@guilhermedeandrade The stackframe I can see in your screenshot looks like it has successfully had the source map applied.

Are there other frames in the stacktrace which have failed to map? Stackframes we determine are not 'in-project' are hidden by default but are shown when you select 'Full trace'.

mattdyoung avatar Aug 04 '20 23:08 mattdyoung

@guilhermedeandrade The stackframe I can see in your screenshot looks like it has successfully had the source map applied.

Are there other frames in the stacktrace which have failed to map? Stackframes we determine are not 'in-project' are hidden by default but are shown when you select 'Full trace'.

Exactly @mattdyoung, the stackframe shown in the screenshot really looks like it has successfully had the source map applied. Here is the screenshot when I select "Full trace":

image

ubmit avatar Aug 05 '20 05:08 ubmit

Hey @guilhermedeandrade, in this event there are 4 frames in the stacktrace. The first one is the only 'in-project' frame, which is the frame most of interest here, and that's mapped successfully. The following 2 frames have also been mapped correctly. If you expand the final frame (which reads global code), you'll notice that this line points to index.android.bundle:836:4 which is :

//# sourceMappingURL=android-release.bundle.map

The failure details are: Source map did not contain mapping for frame index.android.bundle:836:4, which is unsurprising as this is not minified code.

It looks like a lot of your events have this final frame being sent through. Are you modifying the stacktrace?

xljones avatar Aug 05 '20 10:08 xljones

Hey @guilhermedeandrade, in this event there are 4 frames in the stacktrace. The first one is the only 'in-project' frame, which is the frame most of interest here, and that's mapped successfully. The following 2 frames have also been mapped correctly. If you expand the final frame (which reads global code), you'll notice that this line points to index.android.bundle:836:4 which is :

//# sourceMappingURL=android-release.bundle.map

The failure details are: Source map did not contain mapping for frame index.android.bundle:836:4, which is unsurprising as this is not minified code.

It looks like a lot of your events have this final frame being sent through. Are you modifying the stacktrace?

Thanks for your explanation @xander-jones, it helped me to understand the situation! I'm not modifying the stacktrace though.

ubmit avatar Aug 06 '20 13:08 ubmit

Hey @guilhermedeandrade, no problem! On further inspection, it looks like this global code reference is something that we've seen before (albeit rare). It's something that we'll be taking a look into. In the meantime, you're not doing anything incorrectly, and the frames of interest that contain actual code are being unminified correctly. We'll keep you updated with any changes!

xljones avatar Aug 06 '20 16:08 xljones

This has been transferred to the bugsnag-js repo as the Bugsnag react native library is now part of this repository (as of v7.3).

johnkiely1 avatar Sep 14 '20 10:09 johnkiely1