Skip to content

fix(waku): read the renamed unstable_setAllEnv adapter property - #1

Merged
cooper (czxtm) merged 1 commit into
upstream-main-2026-08-13from
fix/waku-unstable-set-all-env
Aug 17, 2026
Merged

fix(waku): read the renamed unstable_setAllEnv adapter property#1
cooper (czxtm) merged 1 commit into
upstream-main-2026-08-13from
fix/waku-unstable-set-all-env

Conversation

@czxtm

Copy link
Copy Markdown
Member

waku 1.0.0-beta.9 renamed the property passed to the createServerEntryAdapter callback:

-{ processRequest, processBuild, setAllEnv, config, notFoundHtml },
+{ processRequest, processBuild, unstable_setAllEnv: setAllEnv, config, notFoundHtml },

unstable_setAllEnv is the name waku documents in docs/guides/adapter-authoring.mdx under Platform Environment Bindings. Aliasing on destructure leaves the call site in defaultExport.fetch untouched.

The catalog moves to beta.9 in the same commit so the peer range and the property name agree.

Why this is worth catching

Destructuring only the old name yields undefined on beta.9, and the call throws inside the deployed Worker:

workerd: Uncaught exception: TypeError: setAllEnv is not a function

Every layer before that is green:

step result
bun install succeeds (peer mismatch is a warning)
waku build succeeds, full RSC output
alchemy deploy succeeds — 13 assets, 2.76 MB worker
deployed Worker 500 on every request, Cloudflare error 1101

So a passing pipeline ships a dead site, and the exact peer pin ("waku": "1.0.0-beta.7") is the only thing standing between a consumer and that outcome.

Verification

Against a real Cloudflare deploy of a Waku app on waku 1.0.0-beta.9, before → after:

/             500 (error 1101)  →  200, 4243 B of server-rendered HTML
/c/<id>       500               →  200
/favicon.svg  500               →  200

Browser-checked as well: the app renders and the console is clean.

Notes for review

  • The change is deliberately minimal — an alias rather than renaming the local binding — so the diff is one line and setAllEnv(env) further down is unchanged.
  • A version-tolerant variant (unstable_setAllEnv ?? setAllEnv) would support beta.7 and beta.9 from one build, but it does not typecheck while the catalog still pins beta.7, since waku's types only declare one name per version. Bumping the catalog is the cleaner fix; happy to switch if supporting both is preferred.
  • Based on alchemy-run/alchemy@8c458c8 rather than this fork's main, which is ~398 commits behind and predates the cloudflare-frameworksfrontend-frameworks rename, so the file does not exist there. Base branch upstream-main-2026-08-13 was pushed for that reason and the diff is the two files below.

waku 1.0.0-beta.9 renamed the property passed to the createServerEntryAdapter
callback from `setAllEnv` to `unstable_setAllEnv` — the name waku documents in
docs/guides/adapter-authoring.mdx under "Platform Environment Bindings".

Destructuring only the old name leaves it undefined on beta.9, and the call in
defaultExport.fetch then throws inside the deployed Worker:

    workerd: Uncaught exception: TypeError: setAllEnv is not a function

The deploy succeeds and every request returns 500 (Cloudflare error 1101), so a
green pipeline ships a dead site.

Aliasing on destructure keeps the call site unchanged. The catalog moves to
beta.9 so the peer range and the property name agree.

Verified against a real Cloudflare deploy of a Waku app: GET / went from 500 to
200 with server-rendered HTML; dynamic routes and public assets recovered too.
@czxtm
cooper (czxtm) merged commit 295c9b3 into upstream-main-2026-08-13 Aug 17, 2026
1 of 6 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