bugsnag-js
bugsnag-js copied to clipboard
A missing source map banner remains visible if stacktrace contains "Global Code"
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?
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 theapplication:didFinishLaunchingWithOptions:
method in yourAppDelegate
class? -
[ ] (Android only)
BugsnagReactNative.start(this)
is present in theonCreate
method of yourMainApplication
class? No
@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'.
@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":
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?
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 toindex.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.
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!
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).