Skip to content

Fix silent rendering errors in Cloudflare adapter workerd prerenderer#16825

Open
astrobot-houston wants to merge 1 commit into
mainfrom
flue/fix-16809
Open

Fix silent rendering errors in Cloudflare adapter workerd prerenderer#16825
astrobot-houston wants to merge 1 commit into
mainfrom
flue/fix-16809

Conversation

@astrobot-houston
Copy link
Copy Markdown
Contributor

Changes

  • Builds now properly fail when components throw errors during workerd prerendering, instead of silently producing truncated HTML with exit code 0
  • Dev mode now displays Astro's error overlay when rendering errors occur, matching the behavior of regular Astro dev servers
  • Creates separate non-streaming app instance for prerender requests so errors propagate synchronously as 500 responses instead of being deferred
  • Adds missing !response.ok check in prerenderer's render() method to detect and throw on error responses
  • Wraps response body streams in dev mode to catch mid-stream errors and inject error overlay scripts

Testing

  • Added prerenderer-render-errors.test.ts that verifies builds fail with clear error messages when components have missing imports
  • Test fixture includes intentionally broken component to trigger ReferenceError during rendering
  • Verified fix works for both build and dev modes with the issue reporter's test case

Docs

  • No docs update needed, this fixes broken behavior to match expected Astro error handling.

Closes #16809

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

🦋 Changeset detected

Latest commit: 76eec04

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 38 packages
Name Type
@astrojs/cloudflare Patch
@test/astro-cloudflare-node-prerender-mdx Patch
@test/astro-cloudflare Patch
@test/astro-cloudflare-allowed-hosts Patch
@test/astro-cloudflare-astro-dev-platform Patch
@test/astro-cloudflare-astro-env Patch
@test/astro-cloudflare-binding-image-service Patch
@test/astro-cloudflare-cache-provider-wait-until Patch
@test/astro-cloudflare-client-address Patch
@test/astro-cloudflare-compile-image-service Patch
@test/astro-cloudflare-custom-entryfile Patch
@test/astro-cloudflare-dev-image-endpoint Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-external-redirects Patch
@test/astro-cloudflare-internal-redirects Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-prerender-node-env Patch
@test/astro-cloudflare-prerender-queue-consumers Patch
@test/astro-cloudflare-prerender-styles Patch
@test/astro-cloudflare-prerenderer-errors Patch
@test/astro-cloudflare-prerenderer-render-errors Patch
@test/routing-priority-cloudflare Patch
@test/cf-server-entry Patch
@test/astro-cloudflare-server-island-prerender-framework Patch
@test/astro-cloudflare-sessions Patch
@test/astro-cloudflare-sql-import Patch
@test/cf-ssr-deps Patch
@test/astro-cloudflare-static Patch
@test/astro-cloudflare-svelte-rune-deps Patch
@test/astro-cloudflare-top-level-return Patch
@test/cf-user-optimize-deps Patch
@test/astro-cloudflare-vite-plugin Patch
@test/astro-cloudflare-with-base Patch
@test/astro-cloudflare-with-react Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-with-svelte Patch
@test/astro-cloudflare-with-vue Patch
@test/astro-cloudflare-wrangler-preview-platform Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added the pkg: integration Related to any renderer integration (scope) label May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix verified Reporter confirmed the triage bot fix works pkg: integration Related to any renderer integration (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloudflare adapter with workerd prerendering: Missing import statement causes silent component render failures instead of showing an error

1 participant