sentry-javascript-bundler-plugins icon indicating copy to clipboard operation
sentry-javascript-bundler-plugins copied to clipboard

False "no sourcemap found" warnings for Rolldown synthetic loader chunks (Vite 8)

Open pmontp19 opened this issue 8 months ago • 4 comments

Environment

  • @sentry/vite-plugin: 5.1.1
  • vite: 8.0.x (Rolldown bundler)
  • build.sourcemap: 'hidden'

Description

When building with Vite 8 (which uses Rolldown instead of Rollup), the Source Map Upload Report emits ~1700 warnings of the form:

~/0064335a-c7d3-4e63-9e77-cb6cd3e211b0-1544.js (no sourcemap found, debug id ...)
  - warning: could not determine a source map reference

These warnings are for Rolldown synthetic loader chunks — small JS stubs (some as small as 132 bytes) that Rolldown generates internally to wire dynamic imports together. These chunks have no source file origin, so Rolldown never produces .map files for them by design.

The same 1719 chunks appear regardless of whether sourcemap is true or 'hidden', confirming that the absence of source maps is intentional on Rolldown's side, not a configuration problem.

Impact

  • The warnings are false positives: they do not indicate missing source maps for application code
  • They pollute CI logs significantly (1700+ lines) making real issues hard to spot
  • Actual app chunks that DO have source maps are correctly paired and uploaded

Expected behavior

The plugin should detect chunks that were never assigned a source file origin (i.e. chunks for which Rolldown emitted no .map at all) and either skip them silently or report them at a lower log level (e.g. debug instead of warning).

Possible fix

When iterating uploaded JS files to match source maps, check whether a chunk has no corresponding .map file in the output directory and no injected debugId. If so, omit it from the warning report or emit it only at debug verbosity.

Reproduction

Build any large Vite 8 app with code splitting enabled via build.rolldownOptions.output.codeSplitting.groups. The number of synthetic chunks scales with the number of dynamic imports in the app.

pmontp19 avatar Mar 17 '26 11:03 pmontp19

from isaacschlueter:

Thanks for reporting this! I see that we're ignoring a similar sort of synthetic small files in the nextjs build plugin for that exact reason, so it does make sense to do the same thing in the vite-plugin. (Also, for the reasons you mention 😅)

linear-code[bot] avatar Mar 17 '26 19:03 linear-code[bot]

The no sourcemap found comes from the Sentry CLI: https://github.com/getsentry/sentry-cli/blob/d893c9d67cdc1f06fc13d95e87c6b46457d408e9/src/utils/sourcemaps.rs#L372

I guess we could

  • Not pass files without a corresponding .map to the CLI
  • Change the logging verbosity

Not sure we'd want to hide these warnings for any file without a map. This warning can help highlight potential issues. Maybe there's a way we can identify these in the writeBundle callback.

timfish avatar Mar 22 '26 23:03 timfish

This should have been fixed via https://github.com/getsentry/sentry-javascript/pull/22267.

If this is still an issue, please let us know and open a new issue in https://github.com/getsentry/sentry-javascript.

Lms24 avatar Oct 29 '26 13:10 Lms24