Skip to content

fix: drop workerd-prelude and move to Astro 7.4.13 - #14

Merged
Madraka merged 1 commit into
mainfrom
fix/astro-7.4.13-no-prelude
Dec 2, 2026
Merged

Madraka merged 1 commit into
mainfrom
fix/astro-7.4.13-no-prelude

Conversation

@Madraka

@Madraka Madraka commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

What

  • src/playground/worker.ts drops import "@cloudhal/cloudflare/workerd-prelude". A comment explains why.
  • astro moves from 7.4.7 to 7.4.13 (lockfile updated). Vite stays at the single 8.3.8 override.

Why

try#13 held Astro at 7.4.7 because the Worker built with 7.4.13 fails at startup with "Top-level await in module is unsettled":

  • the prelude's await import("zod/v4") sits in the entry chunk;
  • the zod facade chunk imports the entry chunk back, so the await waits on itself.

The prelude works around an esbuild ordering bug in wrangler-bundled entries. This entry is bundled by Astro's Vite build, so it does not need it. Details: cloudhal-dev/cloudhal#392.

Checked locally (wrangler dev on the pnpm build output)

  • pnpm check passes: lint, typecheck, 2 tests.
  • Before the change: the Worker fails at startup with the error above.
  • After the change it starts:
Request Result
landing 200
POST /_playground/session 303 → /sites
/sites (Studio) 200
/api/sites lists "Playground Notes"
/s/<session>/ 200, title "Playground Notes"
/s/<session>/rss.xml 200
/api/auth/* 403 (playground, expected)
/mcp the playground block (expected)
reset 204

No ZodLazy or other startup error in the log.

🤖 Generated with Claude Code

The prelude's top-level `await import("zod/v4")` works around an esbuild
ordering bug, but this entry is bundled by Astro's Vite build. With Astro
7.4.13 the zod facade chunk imports the entry chunk back, so the await
never settles and the Worker fails at startup. The Vite build does not
need the workaround (cloudhal-dev/cloudhal#392).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
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