# Content diagnostics

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

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

## Build errors

| Code | What happened |
| --- | --- |
| [`CONTENT_B0001`](https://vitehub.dev/docs/content/diagnostics/content_b0001) | \<value\>: \<message\> |
| [`CONTENT_B0002`](https://vitehub.dev/docs/content/diagnostics/content_b0002) | \<value\> uses the Content cms preset: \<message\> |

## Named errors

| Code | What happened |
| --- | --- |
| [`CONTENT_ACCESS_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_access_invalid) | defineContent({ access }) must be "public" when it is set, received \<access\>. |
| [`CONTENT_AUTHORIZE_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_authorize_invalid) | defineContent({ authorize }) must be a function. |
| [`CONTENT_CACHE_KEY_UNKNOWN`](https://vitehub.dev/docs/content/diagnostics/content_cache_key_unknown) | Unknown content cache key \<key\>. |
| [`CONTENT_CAN_INPUT_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_can_input_invalid) | \<problem\> |
| [`CONTENT_COLLECTION_DEFINITION_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_collection_definition_invalid) | Content collection \<name\> must be defined with documents() or singleton() from @vite-hub/content/collections. |
| [`CONTENT_COLLECTION_NAME_TAKEN`](https://vitehub.dev/docs/content/diagnostics/content_collection_name_taken) | Content collection \<name\> has the same name as a Content source. |
| [`CONTENT_COLLECTION_PATHS_OVERLAP`](https://vitehub.dev/docs/content/diagnostics/content_collection_paths_overlap) | Content collection paths \<name\> (\<path\>) and \<other\> (\<otherPath\>) overlap. |
| [`CONTENT_COLLECTION_UNKNOWN`](https://vitehub.dev/docs/content/diagnostics/content_collection_unknown) | Unknown Content collection \<name\>. Define it in defineContent({ collections }). |
| [`CONTENT_COLLECTIONS_UNDEFINED`](https://vitehub.dev/docs/content/diagnostics/content_collections_undefined) | content.preview.\<method\>() needs document collections. Add defineContent({ workspace, collections }). |
| [`CONTENT_COLLECTIONS_WORKSPACE_MISSING`](https://vitehub.dev/docs/content/diagnostics/content_collections_workspace_missing) | defineContent({ collections }) requires extends: cms from vite-hub/cms, or workspace: the name of a Workspace with retained history. |
| [`CONTENT_DIGEST_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_digest_invalid) | Content \<option\> must be a digest string or null. |
| [`CONTENT_DOCUMENT_ID_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_document_id_invalid) | Content document id must be a relative path such as "hello" or "2026/hello", received \<id\>. |
| [`CONTENT_DOCUMENT_OUTSIDE_COLLECTION`](https://vitehub.dev/docs/content/diagnostics/content_document_outside_collection) | Content document \<id\> is outside collection \<collection\> (\<path\>). |
| [`CONTENT_DOCUMENTS_COMPONENTS_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_documents_components_invalid) | \<problem\> |
| [`CONTENT_DOCUMENTS_FIELD_RESERVED`](https://vitehub.dev/docs/content/diagnostics/content_documents_field_reserved) | documents(\<path\>) has locales, so derivedFrom is the reserved key where a translation records its source. Rename the field. |
| [`CONTENT_DOCUMENTS_FIELDS_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_documents_fields_invalid) | \<problem\> |
| [`CONTENT_DOCUMENTS_LABEL_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_documents_label_invalid) | \<problem\> |
| [`CONTENT_DOCUMENTS_LOCALES_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_documents_locales_invalid) | \<problem\> |
| [`CONTENT_DOCUMENTS_OPTIONS_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_documents_options_invalid) | \<problem\> |
| [`CONTENT_DOCUMENTS_PATH_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_documents_path_invalid) | \<problem\> |
| [`CONTENT_DOCUMENTS_URL_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_documents_url_invalid) | \<problem\> |
| [`CONTENT_EDITOR_FAILED`](https://vitehub.dev/docs/content/diagnostics/content_editor_failed) | The editor `<command>` exited with code \<code\>. |
| [`CONTENT_FIELD_ADDRESS_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_field_address_invalid) | \<value\> is not a Content \<part\>. |
| [`CONTENT_HISTORY_CURSOR_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_history_cursor_invalid) | content.history() received the cursor \<cursor\>, which is not a cursor of a Source page. Pass the cursor of the previous call. |
| [`CONTENT_HISTORY_INPUT_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_history_input_invalid) | content.history() \<problem\> |
| [`CONTENT_LIVE_DOCUMENT_HELD`](https://vitehub.dev/docs/content/diagnostics/content_live_document_held) | \<holder\> is editing this document alone. Live edits save once they stop or someone takes over. |
| [`CONTENT_LIVE_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_live_invalid) | defineContent({ live }) must be 'auto' or false. |
| [`CONTENT_LIVE_ROOM_UNKNOWN`](https://vitehub.dev/docs/content/diagnostics/content_live_room_unknown) | No Content Markdown document matches the live room \<documentId\>. |
| [`CONTENT_LOCALE_UNKNOWN`](https://vitehub.dev/docs/content/diagnostics/content_locale_unknown) | Content collection \<collection\> has the locales \<locales\>, received \<locale\>. |
| [`CONTENT_PIN_SHA_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_pin_sha_invalid) | content.sources.pin() needs a full 40-character commit SHA, received \<sha\>. |
| [`CONTENT_PLUGINS_PARSE_PLUGIN`](https://vitehub.dev/docs/content/diagnostics/content_plugins_parse_plugin) | \<name\> is a Comark parse plugin, and defineContent({ plugins }) takes only Comark Content plugins. Pass it in defineContent({ markdown: { plugins } }). |
| [`CONTENT_PRESET_CONFIGURE_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_preset_configure_invalid) | Content preset \<preset\> must return \<returned\> from configure(). |
| [`CONTENT_PRESET_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_preset_invalid) | See the page of the code. |
| [`CONTENT_PRESET_OPTION_UNKNOWN`](https://vitehub.dev/docs/content/diagnostics/content_preset_option_unknown) | See the page of the code. |
| [`CONTENT_PRESET_WORKSPACE_CONFLICT`](https://vitehub.dev/docs/content/diagnostics/content_preset_workspace_conflict) | defineContent({ extends }) sets workspace. Remove workspace, or name the Workspace in the preset options. |
| [`CONTENT_PREVIEW_ASYNC_CONTEXT_MISSING`](https://vitehub.dev/docs/content/diagnostics/content_preview_async_context_missing) | Content preview needs an async request context (AsyncLocalStorage). On Cloudflare Workers, enable the nodejs_als compatibility flag. |
| [`CONTENT_PREVIEW_DOCUMENT_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_preview_document_invalid) | content.preview.sign() requires { collection, id }: the one document the frame previews. |
| [`CONTENT_PREVIEW_EVENT_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_preview_event_invalid) | content.preview.\<method\>() requires an H3 event or a Request. |
| [`CONTENT_PREVIEW_MAX_AGE_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_preview_max_age_invalid) | \<option\> must be whole seconds from \<min\> to \<max\>. |
| [`CONTENT_PREVIEW_NITRO_REQUIRED`](https://vitehub.dev/docs/content/diagnostics/content_preview_nitro_required) | defineContentPreviewPlugin() needs a Nitro 3 app. |
| [`CONTENT_PREVIEW_PULL_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_preview_pull_invalid) | content.sources.previewLinks() needs a pull request number, received \<pull\>. |
| [`CONTENT_PUBLIC_SOURCE_UNDECIDED`](https://vitehub.dev/docs/content/diagnostics/content_public_source_undecided) | \<readers\> would serve the potentially token-backed Source \<names\> to everyone, and a github() Source or an opaque registered name, reader, or factory can read a private repository with a token. Set authorize to decide who may read (it gets action: "read"), or access: "public" when the content is public (or pass a direct non-GitHub Source definition).\<value\> |
| [`CONTENT_PUBLISH_PR_UNSUPPORTED`](https://vitehub.dev/docs/content/diagnostics/content_publish_pr_unsupported) | publish: 'pr' needs a Workspace Store with pull requests, but Workspace \<workspace\> has none. Use the GitHub store. |
| [`CONTENT_READ_REF_CONFLICT`](https://vitehub.dev/docs/content/diagnostics/content_read_ref_conflict) | Content \<method\>() takes ref or revision, not both. |
| [`CONTENT_REF_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_ref_invalid) | Content ref must be "draft" or "published", received \<ref\>. |
| [`CONTENT_RESOLVE_PATH_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_resolve_path_invalid) | Content resolve() requires an app path such as "/blog/hello". |
| [`CONTENT_REVISION_METADATA_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_revision_metadata_invalid) | Content revision metadata must be an object. |
| [`CONTENT_REVISIONS_LIMIT_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_revisions_limit_invalid) | Content revisions() scanLimit must be an integer from 1 to 1,000. |
| [`CONTENT_ROUTE_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_route_invalid) | defineContent({ route }) must be true or false, received \<route\>. |
| [`CONTENT_RUNTIME_EXPORT_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_runtime_export_invalid) | server/content.ts must default-export the defineContent() runtime. |
| [`CONTENT_SEO_FIELD_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_seo_field_invalid) | \<problem\> |
| [`CONTENT_SEO_OPTIONS_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_seo_options_invalid) | defineContent({ seo }) \<problem\> |
| [`CONTENT_SESSION_KIND_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_session_kind_invalid) | \<problem\> |
| [`CONTENT_SESSION_TOKEN_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_session_token_invalid) | content.sessions requires session: a token of 8 to 128 letters, digits, - or _, one per tab or client. |
| [`CONTENT_SESSION_USER_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_session_user_invalid) | \<problem\> |
| [`CONTENT_SINGLETON_ID_MISMATCH`](https://vitehub.dev/docs/content/diagnostics/content_singleton_id_mismatch) | Content singleton \<name\> has the id \<id\> (\<path\>). Omit the id, or pass \<id\>; received \<received\>. |
| [`CONTENT_SITE_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_site_invalid) | site must be an absolute http(s) URL such as https://example.com, received \<site\>. |
| [`CONTENT_SOURCE_CONFLICT`](https://vitehub.dev/docs/content/diagnostics/content_source_conflict) | Define either source or sources, not both. |
| [`CONTENT_SOURCE_DIGEST_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_source_digest_invalid) | \<problem\> |
| [`CONTENT_SOURCE_HEAD_UNVALIDATED`](https://vitehub.dev/docs/content/diagnostics/content_source_head_unvalidated) | Content source \<source\> has no validated head. Resolve its GitHub commit, then call content.sources.advance(). |
| [`CONTENT_SOURCE_MISSING`](https://vitehub.dev/docs/content/diagnostics/content_source_missing) | Content source \<name\> is missing. |
| [`CONTENT_SOURCE_OPTIONS_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_source_options_invalid) | \<problem\> |
| [`CONTENT_SOURCE_REFS_UNSUPPORTED`](https://vitehub.dev/docs/content/diagnostics/content_source_refs_unsupported) | Content source \<source\> cannot \<action\> refs. Update @vite-hub/source. |
| [`CONTENT_SOURCE_UNKNOWN`](https://vitehub.dev/docs/content/diagnostics/content_source_unknown) | Unknown content source \<name\>. |
| [`CONTENT_SOURCE_VIEWS_DISPOSED`](https://vitehub.dev/docs/content/diagnostics/content_source_views_disposed) | Content source views have been disposed. |
| [`CONTENT_SOURCE_WITHOUT_HEAD`](https://vitehub.dev/docs/content/diagnostics/content_source_without_head) | Content source \<source\> has no head. Only github() Sources have one. Sources with a head: \<heads\>. |
| [`CONTENT_WRITE_LEASE_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_write_lease_invalid) | Content write lease must be 'override' or omitted. |
| [`CONTENT_WRITE_SESSION_INVALID`](https://vitehub.dev/docs/content/diagnostics/content_write_session_invalid) | Content write session must be the content.sessions token of the caller. |

## Errors

| Code | What happened |
| --- | --- |
| [`CONTENT_FORBIDDEN`](https://vitehub.dev/docs/content/diagnostics/content_forbidden) | You cannot \<action\> this \<target\>. |
| [`CONTENT_SCHEDULE_CANCELLED`](https://vitehub.dev/docs/content/diagnostics/content_schedule_cancelled) | Content schedule was cancelled while publishing. |

## Published numbered errors

| Code | What happened |
| --- | --- |
| [`CONTENT_R0001`](https://vitehub.dev/docs/content/diagnostics/content_r0001) | Content Source paths must be strings. |
| [`CONTENT_R0002`](https://vitehub.dev/docs/content/diagnostics/content_r0002) | contentSource() cannot read \<key\> as content. |
| [`CONTENT_R0003`](https://vitehub.dev/docs/content/diagnostics/content_r0003) | contentSource() received duplicate content path \<path\>. |
| [`CONTENT_R0004`](https://vitehub.dev/docs/content/diagnostics/content_r0004) | Content could not find \<path\>. |
| [`CONTENT_R0007`](https://vitehub.dev/docs/content/diagnostics/content_r0007) | Content collections need retained history, but Workspace \<workspaceName\> has none. Use the Blob + Database Store for this Workspace. |
| [`CONTENT_R0009`](https://vitehub.dev/docs/content/diagnostics/content_r0009) | \<message\> |
| [`CONTENT_R0010`](https://vitehub.dev/docs/content/diagnostics/content_r0010) | See the page of the code. |
| [`CONTENT_R0011`](https://vitehub.dev/docs/content/diagnostics/content_r0011) | schedule({ at }) must be a Date or an ISO timestamp with a time zone, such as "2026-10-20T09:00:00Z"; received \<at\>. |
| [`CONTENT_R0012`](https://vitehub.dev/docs/content/diagnostics/content_r0012) | \<message\> |
| [`CONTENT_R0013`](https://vitehub.dev/docs/content/diagnostics/content_r0013) | Content document \<value\> leaves the published site only through content.publish(). Remove it from the draft with remove(), then publish the deletion. |
| [`CONTENT_R0014`](https://vitehub.dev/docs/content/diagnostics/content_r0014) | See the page of the code. |
| [`CONTENT_R0015`](https://vitehub.dev/docs/content/diagnostics/content_r0015) | No dev server is running for \<rootDir\>. |
| [`CONTENT_R0016`](https://vitehub.dev/docs/content/diagnostics/content_r0016) | schedule() needs the Blob + Database store, but Workspace \<workspaceName\> uses the GitHub store, which keeps no schedules. Publish with content.publish() instead. |
| [`CONTENT_R0017`](https://vitehub.dev/docs/content/diagnostics/content_r0017) | publish() published nothing, because open pull requests already publish these documents: \<value\> Merge or close the pull request, then publish again. |
| [`CONTENT_R0018`](https://vitehub.dev/docs/content/diagnostics/content_r0018) | SQLite WASM could not start: \<value\> |
| [`CONTENT_R0019`](https://vitehub.dev/docs/content/diagnostics/content_r0019) | Commit \<sha\> of Content source \<source\> failed validation, so Content keeps \<value\>: \<reason\> |
| [`CONTENT_R0020`](https://vitehub.dev/docs/content/diagnostics/content_r0020) | Content source \<source\> reads GitHub without a token, so it has no head commit. Each load reads the latest commit of its branch without validation. |
| [`CONTENT_R0021`](https://vitehub.dev/docs/content/diagnostics/content_r0021) | Content source \<source\> has a GitHub token, but the app has no KV store, so it has no head commit. Each load reads the latest commit of its branch without validation. |
| [`CONTENT_R0022`](https://vitehub.dev/docs/content/diagnostics/content_r0022) | The KV store failed on \<key\> for Content source \<source\>: \<reason\>. Reads do not fail: they serve the commit that this server already serves, or the latest commit of the branch without validation, and try KV again after 5 seconds. |
| [`CONTENT_R0023`](https://vitehub.dev/docs/content/diagnostics/content_r0023) | Content could not store \<key\> of Content source \<source\> in KV: \<reason\> |
| [`CONTENT_R0024`](https://vitehub.dev/docs/content/diagnostics/content_r0024) | The GitHub webhook delivery \<value\> has no valid X-Hub-Signature-256 signature, so Content ignored it. |
| [`CONTENT_R0025`](https://vitehub.dev/docs/content/diagnostics/content_r0025) | Content received a GitHub push for \<repo\>, but no github() Source reads that repository. Sources with a head: \<heads\>. |
| [`CONTENT_R0026`](https://vitehub.dev/docs/content/diagnostics/content_r0026) | The Content GitHub webhook route answers 404, because the Server Env has no VITEHUB_GITHUB_WEBHOOK_SECRET. |
| [`CONTENT_R0027`](https://vitehub.dev/docs/content/diagnostics/content_r0027) | content.sources.at() cannot open ref \<ref\>: \<reason\>. |
| [`CONTENT_R0028`](https://vitehub.dev/docs/content/diagnostics/content_r0028) | The repository of Content source \<source\> has no ref \<ref\>. |
| [`CONTENT_R0029`](https://vitehub.dev/docs/content/diagnostics/content_r0029) | Content could not look up ref \<ref\> of Content source \<source\> on GitHub: \<reason\> |
| [`CONTENT_R0030`](https://vitehub.dev/docs/content/diagnostics/content_r0030) | Commit \<sha\> of ref \<ref\> in Content source \<source\> failed validation: \<reason\> |
| [`CONTENT_R0031`](https://vitehub.dev/docs/content/diagnostics/content_r0031) | Content source \<source\> does not serve ref \<ref\> to this request: \<reason\>. |
| [`CONTENT_R0032`](https://vitehub.dev/docs/content/diagnostics/content_r0032) | Content could not check on GitHub whether ref \<ref\> of Content source \<source\> is public: \<reason\> |
| [`CONTENT_R0035`](https://vitehub.dev/docs/content/diagnostics/content_r0035) | GitHub refused the branch lookup of Content source \<source\> with 403 or 429, as it does when the rate limit is hit, so Content keeps \<value\>. |
| [`CONTENT_R0040`](https://vitehub.dev/docs/content/diagnostics/content_r0040) | content.history() returned no entries for Content source \<source\> because it reads GitHub without a token. |
| [`CONTENT_R0045`](https://vitehub.dev/docs/content/diagnostics/content_r0045) | defineContent({ previews }) must be true, false, or { source: "\<github() Source name\>" }. |
| [`CONTENT_R0060`](https://vitehub.dev/docs/content/diagnostics/content_r0060) | See the page of the code. |
| [`CONTENT_R0061`](https://vitehub.dev/docs/content/diagnostics/content_r0061) | See the page of the code. |
| [`CONTENT_R0062`](https://vitehub.dev/docs/content/diagnostics/content_r0062) | See the page of the code. |
| [`CONTENT_R0063`](https://vitehub.dev/docs/content/diagnostics/content_r0063) | See the page of the code. |
| [`CONTENT_R0064`](https://vitehub.dev/docs/content/diagnostics/content_r0064) | See the page of the code. |
| [`CONTENT_R0065`](https://vitehub.dev/docs/content/diagnostics/content_r0065) | See the page of the code. |
| [`CONTENT_R0066`](https://vitehub.dev/docs/content/diagnostics/content_r0066) | See the page of the code. |
| [`CONTENT_R0067`](https://vitehub.dev/docs/content/diagnostics/content_r0067) | See the page of the code. |
| [`CONTENT_R0068`](https://vitehub.dev/docs/content/diagnostics/content_r0068) | See the page of the code. |
| [`CONTENT_R0069`](https://vitehub.dev/docs/content/diagnostics/content_r0069) | vitehub content check --dir needs a folder, and \<dir\> is not one. |
| [`CONTENT_R0070`](https://vitehub.dev/docs/content/diagnostics/content_r0070) | content.pages() takes a whole offset of 0 or more and a limit from 1 to \<contentPagesLimit\>. |
| [`CONTENT_R0075`](https://vitehub.dev/docs/content/diagnostics/content_r0075) | Content source \<source\> has no preview links for pull request #\<pull\>: \<reason\>. |
| [`CONTENT_R0076`](https://vitehub.dev/docs/content/diagnostics/content_r0076) | Content opened pull request #\<pull\> but returned no preview links: \<reason\> |
| [`CONTENT_R0077`](https://vitehub.dev/docs/content/diagnostics/content_r0077) | `vitehub content previews comment --post` needs VITEHUB_GITHUB_TOKEN. |
| [`CONTENT_R0078`](https://vitehub.dev/docs/content/diagnostics/content_r0078) | GitHub answered \<status\> when Content tried to \<action\> the preview comment of \<repo\>#\<pull\>. |
| [`CONTENT_R0079`](https://vitehub.dev/docs/content/diagnostics/content_r0079) | content.sources.previewLinks() needs defineContent({ previews: true }): without it, the app serves no /pr/\<number\> URLs. |

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

- [Overview](https://vitehub.dev/raw/docs/content.md)
- [Get started](https://vitehub.dev/raw/docs/content/get-started.md)
- [Configure](https://vitehub.dev/raw/docs/content/configure.md)
- [Server API](https://vitehub.dev/raw/docs/content/server-api.md)
- [Agent capability](https://vitehub.dev/raw/docs/content/agent-capability.md)
- [Limits and errors](https://vitehub.dev/raw/docs/content/limits-and-errors.md)
- [Draft preview](https://vitehub.dev/raw/docs/content/preview.md)
- [Console editor](https://vitehub.dev/raw/docs/content/console.md)
- [Editing together](https://vitehub.dev/raw/docs/content/editing-together.md)
- [Scheduling](https://vitehub.dev/raw/docs/content/scheduling.md)
- [SEO](https://vitehub.dev/raw/docs/content/seo.md)
- [CLI](https://vitehub.dev/raw/docs/content/cli.md)
- [Translate with an Agent](https://vitehub.dev/raw/docs/content/translate-with-an-agent.md)

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