Skip to content

fix(sentry): delete built source maps after upload - #705

Merged
harlan-zw merged 1 commit into
mainfrom
fix/delete-built-source-maps
Nov 18, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/delete-built-source-maps

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Related to #682. Found while reviewing #683.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Production serves every client source map. For example, https://skilld.dev/_nuxt/v2/50scXVS4.js.map returns 200. The Sentry delete glob **/*.map skips dot folders, so it never matched anything in .output/, and the hidden maps shipped as public assets.

The glob now names .output/**/*.map, which covers the public and server maps the Nitro build writes.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

The delete glob `**/*.map` skips dot folders, so it never reached
`.output/`. Every hidden client source map was deployed and served from
`/_nuxt/`, and the server maps stayed in the build output.
@harlan-zw

Copy link
Copy Markdown
Collaborator Author

Agent check (Harlan Agent Kit), run by hand because CI builds without the Sentry token and never deletes maps:

  • Sentry's own globFiles from @sentry/bundler-plugins 11.1.0, run against a tree with .output/public/_nuxt/v2/a.js.map, .output/server/chunks/b.mjs.map, and .nuxt/dist/c.js.map:
    • **/*.map matched nothing.
    • .output/**/*.map matched the public and server maps and skipped .nuxt.
  • Before merge, four client maps linked from the home page returned 200 in production. After deploy, the same URLs should return 404.

@harlan-zw

Copy link
Copy Markdown
Collaborator Author

🤖 Harlan Agent Kit Agent assessment of head bd099fe.

The Service Review was stopped for this head because the review engine is down. An independent read-only subagent reviewed the diff. This is not a Service READY.

No blocker found (confidence 90/100). Deletion runs in the Nuxt close hook, after build:done. That follows the Nitro public asset copy, the skew restore, and every awaited source map upload. The deploy log for run 44239257317 shows that order. globFiles uses dot: false, so only .output/**/*.map reaches the build output.

Logged follow-ups, none above 80:

  • Impact 25: skew storage keeps every file, maps included, and restores about 10 releases into .output/public. A deploy build without the Sentry token deletes nothing, so old maps would ship again. Fail the deploy job if .output/public holds any *.map.
  • Impact 20: the plugin logs deletion only at debug level and swallows rm errors; the same assertion covers it.
  • Impact 10: map URLs are cached as immutable. After deploy, test a cache-busted URL too, and purge /_nuxt/v2/*.map if any return 200.
  • Impact 5: the new code comment carries change history; trim it to the dot-folder constraint.

@harlan-zw
harlan-zw merged commit 9e4463f into main Nov 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant