Skip to content

[Nuxt/Nitro] Sentry-uploaded minified file lines differ from built files (and source maps) #18519

@s1gr1d

Description

@s1gr1d

Description

Reproduction/Setup

Used SDK: @sentry/nuxt

Reproduction Repo: https://github.com/dervondenbergen/sentry-sourcemap-reproduction

Steps to Reproduce

First, enable Nitro source map mapping in Nuxt options: nitro.experimental.sourcemapMinify: false

When throwing an error on the server-side (on page load), Sentry shows the wrong line in the stack trace. This is because the minified file which is uploaded to Sentry does not match the one that is actually deployed. The lines at the top of the file differ (this could also be a problem in Nitro).

Minified, raw stack trace shows line 357

TypeError: numbers.map is not a function Version 0.0.3
    at arrayNumberTransformer (/.output/server/chunks/build/transformers-JL5SrVZo.mjs:357:26)

However, the line with the culprit is actually 369, but Sentry shows the } in the stack preview

Image

Un-minified view in Sentry:
Image

Expected Result

Minified files uploaded to Sentry have lines matching the actual application.

Actual Result

Another image (from actual app, not the reproduction) with source map uploaded to Sentry (left) vs remote source map (right) with the following minified line from the stack trace: .output/server/chunks/build/server.mjs:41275:24 (problem is .map):

Image

Potential Problems

  • Nitro might generate multiple builds, after the files were already uploaded to Sentry.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions