Skip to content

NextJS Webpack Plugin not including all relevant sourcemaps #16359

Closed
@FabianKoder

Description

@FabianKoder

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions