# Rate Limit diagnostics

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

Each Rate Limit error has a stable `code`. Its `docs` link opens the page of that code. This page lists all 56 codes, and [All diagnostics](https://vitehub.dev/docs/reference/diagnostics) lists every primitive.

## Published numbered errors

| Code | What happened |
| --- | --- |
| [`RATE_LIMIT_B0001`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_b0001) | Cloudflare Rate Limit requires rateLimit.namespace to isolate counters between deployments. |
| [`RATE_LIMIT_B0002`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_b0002) | Rate Limit has no native \<hosting\> driver. Configure a custom Rate Limiter instead of falling back to per-instance memory. |
| [`RATE_LIMIT_B0003`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_b0003) | Rate Limit driver cannot be inferred for a production build. Set rateLimit.driver to "cloudflare" or explicitly choose "memory" for a known single-process deployment. |
| [`RATE_LIMIT_B0004`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_b0004) | Nitro Cloudflare Rate Limit declarations changed after config resolution. Generate Rate Limit source files before Vite config resolves. |
| [`RATE_LIMIT_KV_RUNTIME_STORE_UNSUPPORTED`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_kv_runtime_store_unsupported) | The kv Rate Limit driver needs a KV store that every server process shares, but the KV store "\<store\>" uses \<driver\>, which has no shared atomic increment. |
| [`RATE_LIMIT_KV_STORE_UNSUPPORTED`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_kv_store_unsupported) | rateLimit.driver is "kv", but \<store\>. Each server process would count in its own memory. |
| [`RATE_LIMIT_KV_TIMEOUT`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_kv_timeout) | The KV store did not answer the Rate Limit within 1000 milliseconds. |
| [`RATE_LIMIT_MEMORY_PER_PROCESS`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_memory_per_process) | Rate Limit counts requests in the memory of each server process. With several instances, each one allows the full limit. |
| [`RATE_LIMIT_MEMORY_STRICT_UNSUPPORTED`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_memory_strict_unsupported) | Rate Limit "\<name\>" requires strict enforcement, but this build counts in the memory of each server process, so several instances each allow the full limit. |
| [`RATE_LIMIT_R0001`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0001) | \<message\>   at \<file\>:\<line\>:\<column\> |
| [`RATE_LIMIT_R0002`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0002) | Could not parse \<file\> while collecting Rate Limits: \<message\> |
| [`RATE_LIMIT_R0003`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0003) | See the page of the code. |
| [`RATE_LIMIT_R0004`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0004) | cloudflareRateLimitDriver() requires a Cloudflare Rate Limit binding. |
| [`RATE_LIMIT_R0005`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0005) | Cloudflare Rate Limit binding failed. |
| [`RATE_LIMIT_R0006`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0006) | Cloudflare Rate Limit binding returned an invalid result. |
| [`RATE_LIMIT_R0007`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0007) | Memory Rate Limit driver maxEntries must be a positive integer. |
| [`RATE_LIMIT_R0008`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0008) | Memory Rate Limit driver reached maxEntries (\<maxEntries\>) while active counters remain. |
| [`RATE_LIMIT_R0009`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0009) | See the page of the code. |
| [`RATE_LIMIT_R0010`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0010) | `<guard>()` requires a non-empty stable ID. |
| [`RATE_LIMIT_R0011`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0011) | `<guard>()` does not support the "\<unknownKey\>" option. |
| [`RATE_LIMIT_R0012`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0012) | `<guard>()` key must be a non-empty string. |
| [`RATE_LIMIT_R0013`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0013) | See the page of the code. |
| [`RATE_LIMIT_R0015`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0015) | Rate Limit "\<name\>" requires strict enforcement, but Cloudflare's native Rate Limiting binding is best-effort. |
| [`RATE_LIMIT_R0016`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0016) | Rate Limit "\<name\>" uses \<window\>, but Cloudflare Rate Limiting supports only 10s and 1m windows. |
| [`RATE_LIMIT_R0019`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0019) | Rate Limit driver "\<driverName\>" must declare capabilities. |
| [`RATE_LIMIT_R0020`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0020) | Rate Limit driver "\<driverName\>" must declare valid enforcement. |
| [`RATE_LIMIT_R0021`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0021) | Rate Limit driver "\<driverName\>" must declare counter scope. |
| [`RATE_LIMIT_R0022`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0022) | Rate Limit driver "\<driverName\>" must declare rejected-attempt behavior. |
| [`RATE_LIMIT_R0023`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0023) | Rate Limit driver "\<driverName\>" windows must contain positive integer milliseconds. |
| [`RATE_LIMIT_R0024`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0024) | Rate Limit driver result \<label\> must be a non-negative integer. |
| [`RATE_LIMIT_R0025`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0025) | Rate Limit driver consume() must return an object with an allowed boolean. |
| [`RATE_LIMIT_R0026`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0026) | Rate Limit driver result resetAt must be a positive timestamp at most 8640000000000000 milliseconds. |
| [`RATE_LIMIT_R0027`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0027) | Rate Limit driver "\<driverName\>" provides best-effort enforcement, but this policy requires strict enforcement. |
| [`RATE_LIMIT_R0028`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0028) | Rate Limit driver "\<driverName\>" does not support a \<windowMs\>ms window. Supported windows: \<value\>ms. |
| [`RATE_LIMIT_R0029`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0029) | createRateLimiter() requires a Rate Limit driver with a consume() function. |
| [`RATE_LIMIT_R0030`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0030) | Rate Limiter consume() requires a non-empty key. |
| [`RATE_LIMIT_R0031`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0031) | Rate Limit window must use a duration such as "10s", "1m", "1h", or "1d". |
| [`RATE_LIMIT_R0032`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0032) | Rate Limit window must resolve to finite milliseconds greater than zero and at most 8640000000000000. |
| [`RATE_LIMIT_R0033`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0033) | Rate Limit policy must be an object. |
| [`RATE_LIMIT_R0034`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0034) | Rate Limit limit must be a positive integer. |
| [`RATE_LIMIT_R0035`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0035) | Rate Limit enforcement must be "best-effort" or "strict". |
| [`RATE_LIMIT_R0036`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0036) | Rate Limit failure must be "allow" or "deny". |
| [`RATE_LIMIT_R0037`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0037) | Rate Limit driver peek() must return an object with a non-negative integer used count. |
| [`RATE_LIMIT_R0038`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0038) | Rate Limiter \<operation\>() requires a non-empty key. |
| [`RATE_LIMIT_R0039`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0039) | Rate Limit name must be a non-empty string. |
| [`RATE_LIMIT_R0040`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0040) | Unknown option: \<arg\>. |
| [`RATE_LIMIT_R0041`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0041) | See the page of the code. |
| [`RATE_LIMIT_R0042`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0042) | Rate Limit driver reset() must return [undefined, undefined] or [error, undefined]. |
| [`RATE_LIMIT_R0043`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0043) | Rate Limit driver peek() must return [undefined, value] or [error, undefined]. |
| [`RATE_LIMIT_R0044`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0044) | Rate Limit driver consume() must return [undefined, value] or [error, undefined]. |
| [`RATE_LIMIT_R0045`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0045) | KV Rate Limit fixed-window end must be a positive timestamp at most 8640000000000000 milliseconds. |
| [`RATE_LIMIT_R0046`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0046) | kvRateLimitDriver() requires a KV store with increment(), get(), and delete(). |
| [`RATE_LIMIT_R0047`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_r0047) | The kv Rate Limit driver needs KV. Enable KV in the app, or pass a KV store to setRateLimitRuntimeConfig(). |
| [`RATE_LIMIT_REFUSAL_OPTION_INVALID`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_refusal_option_invalid) | `requireRateLimit()` \<option\> must be a non-empty string. |
| [`RATE_LIMIT_RENAMED_PROVIDER_KEY`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_renamed_provider_key) | `rateLimit.provider` is \<value\>. ViteHub renamed this key to `driver`, and it does not read `provider`, so Rate Limit would not use the driver you chose. |

## Operation errors

| Code | What happened |
| --- | --- |
| [`RATE_LIMIT_OPERATION_FAILED`](https://vitehub.dev/docs/rate-limit/diagnostics/rate_limit_operation_failed) | The Rate Limit operation failed. |

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

- [Overview](https://vitehub.dev/raw/docs/rate-limit.md)
- [Get started](https://vitehub.dev/raw/docs/rate-limit/get-started.md)
- [Server API](https://vitehub.dev/raw/docs/rate-limit/server-api.md)
- [Agent capability](https://vitehub.dev/raw/docs/rate-limit/agent-capability.md)
- [Hosts](https://vitehub.dev/raw/docs/rate-limit/hosts.md)
- [Limits and errors](https://vitehub.dev/raw/docs/rate-limit/limits-and-errors.md)

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