Skip to content

martinsilha/astro-cloudflare-sentry-prerender-bug

Repository files navigation

Astro Cloudflare + Sentry prerender repro

Install

pnpm install

Repro (fails)

SENTRY_AUTH_TOKEN=fake-token pnpm run build

Expected: build succeeds.

Actual: build logs an error during prerendering static routes with:

TypeError: addEventListener(): useCapture must be false

and writes an empty prerendered file:

wc -c dist/client/index.html
# 0 dist/client/index.html

Workaround (passes)

In astro.config.mjs, change Cloudflare adapter to:

adapter: cloudflare({
  configPath: './wrangler.jsonc',
  prerenderEnvironment: 'node'
})

Then rerun:

SENTRY_AUTH_TOKEN=fake-token pnpm run build

Build succeeds.

About

@astrojs/cloudflare workerd prerender + @sentry/astro logs "addEventListener(): useCapture must be false" and writes empty prerendered HTML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors