Minimal reproduction for a local-development issue observed with Alchemy
2.0.0-beta.72.
The repository starts from Alchemy's cloudflare-tanstack example. The first
commit is the working baseline: an Effect-native backend Worker and a
TanStack Start Cloudflare.Website.Vite Worker communicate through an Alchemy
service binding.
The second commit adds one Cloudflare Queue and the backend's
Cloudflare.Queues.WriteQueueBinding. With that change, the backend remains
reachable directly, but the Website's service binding returns Alchemy's local
proxy error:
503 Worker "<backend-name>" not found. Make sure the worker is running locally.
This repository contains no application credentials, .env files, Cloudflare
account identifiers, API keys, authentication state, or production code.
The reproduction was observed with:
- Alchemy
2.0.0-beta.72 - Effect
4.0.0-rc.108 - workerd
1.20260704.1(installed by Alchemy) - Node.js
>=22.18.0 - pnpm
10.33.2
The commits intentionally separate the control and failing case:
d92baff chore: establish working Alchemy baseline
e68c60d test: reproduce queue binding service failure
To inspect the baseline:
git checkout d92baffTo inspect the failing case:
git checkout e68c60dpnpm install
pnpm checkNo credentials or .env file are required for the local reproduction.
git checkout d92baff
pnpm exec alchemy dev --stage queue-binding-baselineThe dedicated ports are:
- backend:
http://localhost:14337 - Website:
http://localhost:15173
In another terminal:
curl -i 'http://localhost:14337/?key=missing'
curl -i 'http://localhost:15173/api/hello?via=fetch&key=missing'Both requests reach the backend and return its expected 404 Not found
response.
git checkout e68c60d
pnpm exec alchemy dev --stage queue-binding-failureRun the same requests:
curl -i 'http://localhost:14337/?key=missing'
curl -i 'http://localhost:15173/api/hello?via=fetch&key=missing'Observed result:
Direct backend: 404 Not found
Website -> backend: 503 Worker "<backend-name>" not found
The Alchemy stack reports both Workers as ready. The direct backend request
continues to work, while the Website's env.BACKEND.fetch(...) call cannot
resolve the backend target in the local service-binding proxy.
The failing commit adds only:
export const Queue = Cloudflare.Queues.Queue("Queue")and to the existing backend Worker:
const queueResource = yield* Queue
const queue = yield* Cloudflare.Queues.WriteQueue(queueResource)with:
Cloudflare.Queues.WriteQueueBindingprovided alongside the existing R2 binding.
The queue client is not used by the tested HTTP route. Its initialization and binding registration are sufficient to reproduce the service-binding failure.
WriteQueueBinding
-> host.bind(...)
-> local Worker binding metadata/materialization
-> local registry/service-binding update
-> Website env.BACKEND target map
The Queue resource alone does not reproduce the issue. The baseline's existing Website-to-backend service binding also works. The smallest failing change is the backend's Queue producer binding initialization.
alchemy.run.ts— backend, Website, R2 Bucket, and Queue resourcessrc/backend.ts— Effect-native backend and binding layerssrc/routes/api.hello.ts— Website route forwarding toenv.BACKENDsrc/env.ts— Website Worker environment proxyvite.config.ts— TanStack Start Vite configuration