# QUEUE_DISABLED

<!-- Generated by docs/modules/diagnostics from the package catalogs. Write a guide in docs/diagnostics/<CODE>.md instead of editing this file. -->

`sendQueue()`, `useQueue()`, `dynamicQueue`, or `vitehub queue list` throws `QUEUE_DISABLED`. The runtime has Queue turned off, so it sends no job.

## Why it happens

When the Queue config that the runtime installed is `false`, every Queue call throws this error before it looks up the Queue Definition. In Vitest, the generated test setup `.vitehub/queue/test-setup.mjs` installs the config. The config is `false` in two cases:

- An app that uses `@vite-hub/queue` alone passes `false` to `hubQueue()`.
- `queue.driver` names a driver that is not the host of the Nitro preset. For example, `driver: 'cloudflare'` with the Vercel preset. ViteHub then turns Queue off and does not report the conflict at build time.

In these two cases, a dev or built server registers no Queue runtime. Queue calls there throw [`QUEUE_DEFINITION_NOT_FOUND`](https://vitehub.dev/docs/queue/diagnostics/queue_definition_not_found), not this error.

`deferQueue()` does not throw. It logs the error and passes it to `onDispatchError`.

With `vitehub()`, `queue: false` or no `queue` option adds no Queue runtime. Queue calls then throw [`QUEUE_DEFINITION_NOT_FOUND`](https://vitehub.dev/docs/queue/diagnostics/queue_definition_not_found) instead.

## Fix it

```diff [vite.config.ts]
 export default defineConfig({
-  plugins: [hubQueue(false)],
+  plugins: [hubQueue()],
 })
```

Remove `false`. Without a `driver`, ViteHub selects the driver from the host: Cloudflare, Vercel, or `local` for a Node server.

```diff [vite.config.ts]
 export default defineConfig({
-  plugins: [hubQueue({ driver: 'cloudflare' })],
+  plugins: [hubQueue({ driver: 'vercel' })],
   nitro: { preset: 'vercel' },
 })
```

Make the `driver` of `hubQueue()` match the Nitro preset, or remove `driver`. If you use `vitehub()`, enable Queue with `vitehub({ host, queue: true })`. It sets the driver from the host.

## Check the fix

Run the Vitest test again, then open `.vitehub/queue/test-setup.mjs`. It must not contain `setQueueRuntimeConfig(false)`. The Queue call in the test returns `[error, result]` and does not throw `QUEUE_DISABLED`.

## Related

- [Queue configuration](https://vitehub.dev/docs/queue/configure)
- [Queue limits and errors](https://vitehub.dev/docs/queue/limits-and-errors)
- [Queue Server API](https://vitehub.dev/docs/queue/server-api)
- [`QUEUE_DEFINITION_NOT_FOUND`](https://vitehub.dev/docs/queue/diagnostics/queue_definition_not_found)
- [`QUEUE_MISSING_DRIVER`](https://vitehub.dev/docs/queue/diagnostics/queue_missing_driver)

## Source

`QUEUE_DISABLED` belongs to the `queue` package. Its catalog entry is in [`src/error-diagnostics.ts`](https://github.com/vite-hub/vitehub/blob/main/packages/queue/src/error-diagnostics.ts#L86). It is raised in [`src/runtime/client.ts`](https://github.com/vite-hub/vitehub/blob/main/packages/queue/src/runtime/client.ts#L72), [`src/runtime/client.ts`](https://github.com/vite-hub/vitehub/blob/main/packages/queue/src/runtime/client.ts#L94), [`src/runtime/operations.ts`](https://github.com/vite-hub/vitehub/blob/main/packages/queue/src/runtime/operations.ts#L88), [`src/runtime/operations.ts`](https://github.com/vite-hub/vitehub/blob/main/packages/queue/src/runtime/operations.ts#L141).

See [all Queue diagnostics](https://vitehub.dev/docs/queue/diagnostics).

<!-- vitehub-docs:section-links -->
## In this section

- [Overview](https://vitehub.dev/raw/docs/queue.md)
- [Get started](https://vitehub.dev/raw/docs/queue/get-started.md)
- [Configure](https://vitehub.dev/raw/docs/queue/configure.md)
- [Server API](https://vitehub.dev/raw/docs/queue/server-api.md)
- [Hosts](https://vitehub.dev/raw/docs/queue/hosts.md)
- [Limits and errors](https://vitehub.dev/raw/docs/queue/limits-and-errors.md)
- [Concepts](https://vitehub.dev/raw/docs/queue/concepts.md)

Next: [Limits and errors](https://vitehub.dev/raw/docs/queue/limits-and-errors.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
