[Bug]: @astrojs/cloudflare prerender worker inherits queues.consumers, causing Miniflare ERR_MULTIPLE_CONSUMERS error
Astro v6.1.3
Vite v7.3.1
Node v25.8.2
System macOS (x64)
Package Manager npm
Output static
Adapter @astrojs/cloudflare (v13.1.7)
Integrations none
N/A (build-time error)
When a project uses Cloudflare Queues (with queues.consumers in wrangler.json) and has a mix of prerendered and server-rendered pages, astro build fails with:
QueuesError [ERR_MULTIPLE_CONSUMERS]: Multiple consumers defined for queue "my-queue": "prerender" and "mre-prerender-queue"
The @astrojs/cloudflare adapter's prerenderWorker.config callback spreads the entire entryWorkerConfig into the prerender worker config:
// node_modules/@astrojs/cloudflare/dist/index.js, line 108
config(_, { entryWorkerConfig }) {
return {
...entryWorkerConfig, // <-- includes queues.consumers
name: "prerender",
};
},This copies queues.consumers into the prerender worker. Miniflare then sees two workers (the entry worker and the prerender worker) both consuming the same queue and rejects the configuration.
The build should succeed. The prerender worker only needs to render static HTML — it should not inherit queue consumer bindings from the entry worker.
The prerenderWorker.config callback should strip queues.consumers (and potentially other non-applicable bindings) from the prerender worker config:
config(_, { entryWorkerConfig }) {
const { queues, ...rest } = entryWorkerConfig;
return {
...rest,
name: "prerender",
// Preserve producers but strip consumers so Miniflare doesn't
// reject the config for having two workers consuming the same queue.
...(queues?.producers?.length && {
queues: { producers: queues.producers },
}),
};
},https://github.com/adamchal/cloudflare-prerender-queue
- I am willing to submit a pull request for this issue.