Astro Info
Astro v6.0.4
Vite v7.3.1
Node v22.19.0
System Linux (x64)
Package Manager pnpm
Output static
Adapter @astrojs/cloudflare (v13.1.1)
Integrations none
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Using Astro static output with the Cloudflare adapter and Sentry enabled at build time causes Cloudflare's default workerd prerender environment to throw:
TypeError: addEventListener(): useCapture must be false
during prerendering static routes.
Minimal repro setup:
Observed behavior in repro:
SENTRY_AUTH_TOKEN=fake-token pnpm run build
- Build logs the
useCapture must be false stack during prerender
- Build still finishes as complete
dist/client/index.html is empty (0 bytes), indicating broken prerender output
Error stack in repro points into generated .prerender chunk with calls like:
whenReady
onTTFB
instrumentTtfb
startTrackingWebVitals
What's the expected result?
Cloudflare Workers build should either:
- prerender correctly without runtime errors, producing non-empty HTML, or
- fail hard with a non-zero exit code instead of silently producing empty prerender output.
Link to Minimal Reproducible Example
https://github.com/martinsilha/astro-cloudflare-sentry-prerender-bug
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Using Astro static output with the Cloudflare adapter and Sentry enabled at build time causes Cloudflare's default
workerdprerender environment to throw:TypeError: addEventListener(): useCapture must be falseduring
prerendering static routes.Minimal repro setup:
[email protected]@astrojs/[email protected]@sentry/[email protected]@sentry/[email protected]SENTRY_AUTH_TOKENis set (any non-empty value)sentry.client.config.jsandsentry.server.config.jscallSentry.init(...)workerd)Observed behavior in repro:
SENTRY_AUTH_TOKEN=fake-token pnpm run builduseCapture must be falsestack during prerenderdist/client/index.htmlis empty (0bytes), indicating broken prerender outputError stack in repro points into generated
.prerenderchunk with calls like:whenReadyonTTFBinstrumentTtfbstartTrackingWebVitalsWhat's the expected result?
Cloudflare Workers build should either:
Link to Minimal Reproducible Example
https://github.com/martinsilha/astro-cloudflare-sentry-prerender-bug
Participation