Skip to content

NextJS Webpack Plugin not including all relevant sourcemaps #16359

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

Open
3 tasks done
FabianKoder opened this issue May 22, 2025 · 1 comment
Open
3 tasks done

NextJS Webpack Plugin not including all relevant sourcemaps #16359

FabianKoder opened this issue May 22, 2025 · 1 comment

Comments

@FabianKoder
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

9.22.0

Framework Version

Next 15.3.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

We recently migrated to the Webpack plugin and used to upload the sourcemaps using a GitHub Action - since the migration, we have many issues that throw "In App" but sourcemaps are only available up to a certain point. Previously, the same issues had 100% sourcemap coverage.

Image

As seen here, main-*.js gets explicitly excluded from the sourcemap upload, even with widenClientFileUpload enabled:

// TODO: We should think about uploading these when `widenClientFileUpload` is `true`. They may be useful in some situations.
sourcemapUploadIgnore.push(
path.posix.join(distDirAbsPath, 'static', 'chunks', 'framework-*'),
path.posix.join(distDirAbsPath, 'static', 'chunks', 'framework.*'),
path.posix.join(distDirAbsPath, 'static', 'chunks', 'main-*'),
path.posix.join(distDirAbsPath, 'static', 'chunks', 'polyfills-*'),
path.posix.join(distDirAbsPath, 'static', 'chunks', 'webpack-*'),
);
}

It seems some of our code is being bundled in the main bundle (my suspicion is that in this specific case it happens because the safeParse function is also used in instrumentation-client), which is now not available anymore to view.

Expected Result

Being able to see sourcemaps for the main bundle as well

Actual Result

See reproduction steps

@chargome
Copy link
Member

chargome commented May 22, 2025

Hey @FabianKoder thanks for reaching out!

Assuming you already have set widenClientFileUpload: true in your withSentry config, we can try to widen the scope of this flag. We'll look into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Development

No branches or pull requests

2 participants