Skip to content

Sentry breaks application when sourcemaps aren't included with application bundle #9378

Closed
@nathanchapman

Description

@nathanchapman

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

7.73.0+

Framework Version

React 17.0.2

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

Upgraded from 7.72.0 to 7.73.0 (and later, tested up to 7.75.1 as well)
Upload source maps to sentry
Delete source maps from bundle e.g.

rm build/static/{js,css}/*.map
sed -i'' -e '/\/\/# sourceMappingURL.*/d' build/static/js/*.js
sed -i'' -e '/\/\*# sourceMappingURL.*/d' build/static/css/*.css

Deploy application (in our case, to Firebase)

Expected Result

Application loads as expected, like it did with 7.72.0 and earlier

Actual Result

Application fails to load with Uncaught (in promise) ChunkLoadError: Loading chunk 825 failed.

Activity

moved this to Waiting for: Product Owner in GitHub Issues with 👀on Oct 26, 2023
AbhiPrasad

AbhiPrasad commented on Oct 26, 2023

@AbhiPrasad
Member

Hey @nathanchapman - could you provide your SDK setup? Could you go into details about your firebase setup? How are you uploading sourcemaps?

The only major change in 7.73.0 was regarding session replay, are you using that?

Providing a minimal reproduction would also allow us to debug this faster. Thanks!

moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀on Oct 26, 2023
nathanchapman

nathanchapman commented on Oct 26, 2023

@nathanchapman
Author

Hey @AbhiPrasad thank you for the quick response!

We're uploading source maps with the GitHub Action https://github.com/getsentry/action-release/
Then we delete them from the application bundle using the snippet in the issue description
Then we deploy to Firebase with https://github.com/w9jds/firebase-action/

Nothing has changed with anything else, those dependencies are pinned and I've repeatedly confirmed it's the upgrade to 7.73.0 and above causing the issue.

We are not using session replay to my knowledge (EDIT: confirmed we are not). That's the most puzzling part of this (it took a very long time to narrow this down lol)

moved this to Waiting for: Product Owner in GitHub Issues with 👀on Oct 26, 2023
AbhiPrasad

AbhiPrasad commented on Oct 26, 2023

@AbhiPrasad
Member

If you remove the source maps github action (but still delete sourcemaps), does the error still occur?

This might be because we are using an outdated version of sentry-cli in the GitHub Action: getsentry/action-release#168

moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀on Oct 26, 2023
nathanchapman

nathanchapman commented on Oct 26, 2023

@nathanchapman
Author

If you remove the source maps github action (but still delete sourcemaps), does the error still occur?

Yes, that's actually how we handle PRs. The app is deployed to a preview "hosting channel" in Firebase but no source map upload to Sentry occurs since it's not a "release"

We were only deleting source maps on the workflow that runs on main ("live" hosting channel for development) so this wasn't caught in the original PR until after merged and deployed (because the preview channel worked fine / tests passed). I've confirmed it's only the combination of deleting sourcemaps + upgrading to @sentry/browser v7.73.0 and above, by adding the deletion of source maps to our PR workflow on a branch with the upgrade being the only other change. When I remove the delete sourcemaps step, the app with sentry 7.73.0+ loads just fine

The addition/removal of the sourcemap upload with getsentry/action-release had no affect

22 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: browserIssues related to the Sentry Browser SDK

    Type

    No type

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nathanchapman@AbhiPrasad

        Issue actions

          Sentry breaks application when sourcemaps aren't included with application bundle · Issue #9378 · getsentry/sentry-javascript