Skip to content

Docs sourcemap upload has been a no-op since Astro 6 upgrade (#816); CLI silently succeeds on 0 files #845

@BYK

Description

@BYK

Summary

The docs site sourcemap upload step in CI has been a silent no-op since the Astro 6 upgrade (#816, merged 2026-04-22). Every push to main ran sentry sourcemap upload docs/dist/ with Files uploaded: 0, producing no Sentry symbolication for cli.sentry.dev.

Because the CLI's sourcemap upload command exited 0 on zero files ("No JS + sourcemap pairs found. Run sentry sourcemap inject first"), CI stayed green and the regression went unnoticed.

Timeline

Root cause

docs/astro.config.mjs sets:

vite: {
  build: {
    sourcemap: "hidden",
  },
},

Astro 6 uses Vite 7's Environments API and reads the setting from vite.environments.{client,ssr}.build.sourcemap (see astro/dist/core/build/static-build.js:281), falling back to false if unset. The legacy top-level vite.build.sourcemap path is ignored for the client bundle. Astro 5 honored the legacy path, so the regression landed invisibly with the v6 upgrade.

Also: @sentry/astro's internal config-patching logic that normally re-applies sourcemap settings is gated on sourceMapsUploadOptions.enabled === true, which we intentionally set to false (we use our own CLI post-build to avoid pulling in @sentry/cli, see docs/astro.config.mjs:34). So that code path does not rescue us.

Fix (in-flight)

PR #TBD (follow-up to this issue):

  1. Set vite.environments.{client,ssr}.build.sourcemap: "hidden" in docs/astro.config.mjs. Locally this yields 11 .map files in docs/dist/_astro/ (previously 0).
  2. Make sentry sourcemap inject and sentry sourcemap upload error by default when zero JS+sourcemap pairs are discovered, with --allow-empty as an opt-in escape hatch. A silent zero-file upload/inject is almost always a bundler misconfiguration, and erroring out turns the next regression into an immediate CI failure.
  3. No CI wiring changes needed — the default-strict behavior catches the regression automatically on the next push.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions