Astro Info
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
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
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.
What's the expected result?
The build should succeed. The prerender worker only needs to render static HTML — it should not inherit queue consumer bindings from the entry worker.
Potential fix
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 },
}),
};
},
Link to Minimal Reproducible Example
https://github.com/adamchal/cloudflare-prerender-queue
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
When a project uses Cloudflare Queues (with
queues.consumersinwrangler.json) and has a mix of prerendered and server-rendered pages,astro buildfails with:The
@astrojs/cloudflareadapter'sprerenderWorker.configcallback spreads the entireentryWorkerConfiginto the prerender worker config:This copies
queues.consumersinto the prerender worker. Miniflare then sees two workers (the entry worker and the prerender worker) both consuming the same queue and rejects the configuration.What's the expected result?
The build should succeed. The prerender worker only needs to render static HTML — it should not inherit queue consumer bindings from the entry worker.
Potential fix
The
prerenderWorker.configcallback should stripqueues.consumers(and potentially other non-applicable bindings) from the prerender worker config:Link to Minimal Reproducible Example
https://github.com/adamchal/cloudflare-prerender-queue
Participation