# Source diagnostics

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

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

## Runtime errors

| Code | What happened |
| --- | --- |
| [`SOURCE_R0001`](https://vitehub.dev/docs/source/diagnostics/source_r0001) | Collection response must be an object. |
| [`SOURCE_R0002`](https://vitehub.dev/docs/source/diagnostics/source_r0002) | Collection response must contain items and nextCursor. |
| [`SOURCE_R0003`](https://vitehub.dev/docs/source/diagnostics/source_r0003) | Collection returned the same cursor twice. |
| [`SOURCE_R0004`](https://vitehub.dev/docs/source/diagnostics/source_r0004) | Collection \<label\> must be a positive integer. |
| [`SOURCE_R0005`](https://vitehub.dev/docs/source/diagnostics/source_r0005) | Collection cursor() must return a JSON-serializable value. |
| [`SOURCE_R0006`](https://vitehub.dev/docs/source/diagnostics/source_r0006) | array() item \<index\> does not match its schema: \<value\> |
| [`SOURCE_R0008`](https://vitehub.dev/docs/source/diagnostics/source_r0008) | Collection defaultLimit cannot exceed maxLimit. |
| [`SOURCE_R0009`](https://vitehub.dev/docs/source/diagnostics/source_r0009) | array() load must return an array or { items, digest }. |
| [`SOURCE_R0011`](https://vitehub.dev/docs/source/diagnostics/source_r0011) | Collection query parameter \<key\> must have one value. |
| [`SOURCE_R0012`](https://vitehub.dev/docs/source/diagnostics/source_r0012) | Collection limit must be a positive integer. |
| [`SOURCE_R0013`](https://vitehub.dev/docs/source/diagnostics/source_r0013) | Collection limit must be a positive integer. |
| [`SOURCE_R0014`](https://vitehub.dev/docs/source/diagnostics/source_r0014) | Collection pages may only contain plain objects, arrays, and toJSON() values. Use transform() for class instances and other object types. |
| [`SOURCE_R0015`](https://vitehub.dev/docs/source/diagnostics/source_r0015) | Collection page is not JSON-serializable. |
| [`SOURCE_R0016`](https://vitehub.dev/docs/source/diagnostics/source_r0016) | defineCollectionHandler() requires a Collection. |
| [`SOURCE_R0017`](https://vitehub.dev/docs/source/diagnostics/source_r0017) | file requires a path or workspacePath. |
| [`SOURCE_R0018`](https://vitehub.dev/docs/source/diagnostics/source_r0018) | file requires path when content is not provided. |
| [`SOURCE_R0021`](https://vitehub.dev/docs/source/diagnostics/source_r0021) | mcpResources({ server }) must resolve to an MCP client or MCP client config. |
| [`SOURCE_R0022`](https://vitehub.dev/docs/source/diagnostics/source_r0022) | mcpResources({ server }) requires an MCP server. |
| [`SOURCE_R0023`](https://vitehub.dev/docs/source/diagnostics/source_r0023) | See the page of the code. |
| [`SOURCE_R0024`](https://vitehub.dev/docs/source/diagnostics/source_r0024) | Collection authorize must be true or a function. |
| [`SOURCE_R0025`](https://vitehub.dev/docs/source/diagnostics/source_r0025) | Collection authorize requires Auth. Enable Auth and add `server/auth.ts`. |
| [`SOURCE_R0026`](https://vitehub.dev/docs/source/diagnostics/source_r0026) | See the page of the code. |
| [`SOURCE_R0027`](https://vitehub.dev/docs/source/diagnostics/source_r0027) | See the page of the code. |
| [`SOURCE_R0028`](https://vitehub.dev/docs/source/diagnostics/source_r0028) | array() \<label\> must be a list of field paths. |
| [`SOURCE_R0029`](https://vitehub.dev/docs/source/diagnostics/source_r0029) | Collection orderBy columns must encode as number or string values. |
| [`SOURCE_R0030`](https://vitehub.dev/docs/source/diagnostics/source_r0030) | Collection orderBy columns must belong to its table. |
| [`SOURCE_R0031`](https://vitehub.dev/docs/source/diagnostics/source_r0031) | Collection orderBy columns must encode as scalar values. |
| [`SOURCE_R0032`](https://vitehub.dev/docs/source/diagnostics/source_r0032) | Collection orderBy columns must be non-null. |
| [`SOURCE_R0033`](https://vitehub.dev/docs/source/diagnostics/source_r0033) | Collection orderBy tieBreaker must be unique. |
| [`SOURCE_R0034`](https://vitehub.dev/docs/source/diagnostics/source_r0034) | Collection request to \<endpoint\> failed with status \<status\>. |

## Build errors

| Code | What happened |
| --- | --- |
| [`SOURCE_B0001`](https://vitehub.dev/docs/source/diagnostics/source_b0001) | Generated \<generatedHandler\> route \<route\> conflicts with an existing \<generatedHandler\>. Remove the matching server route. |
| [`SOURCE_B0002`](https://vitehub.dev/docs/source/diagnostics/source_b0002) | Generated \<handler\> route \<route\> conflicts with an existing \<handler\>. Remove the matching server route. |
| [`SOURCE_B0003`](https://vitehub.dev/docs/source/diagnostics/source_b0003) | Collection file \<value\> must use a valid JavaScript identifier as its filename. |
| [`SOURCE_B0004`](https://vitehub.dev/docs/source/diagnostics/source_b0004) | Collection file \<value\> must export a Collection named \<exportName\> to match its filename. |
| [`SOURCE_B0005`](https://vitehub.dev/docs/source/diagnostics/source_b0005) | Collection name \<name\> is defined in more than one server directory. |
| [`SOURCE_B0006`](https://vitehub.dev/docs/source/diagnostics/source_b0006) | Collection names \<firstName\> and \<secondName\> generate the same route module on case-insensitive filesystems. |
| [`SOURCE_B0007`](https://vitehub.dev/docs/source/diagnostics/source_b0007) | Content is defined in more than one server directory. |
| [`SOURCE_B0008`](https://vitehub.dev/docs/source/diagnostics/source_b0008) | Content file \<name\> must default-export the result of defineContent(): `export default defineContent({ ... })`. |
| [`SOURCE_B0009`](https://vitehub.dev/docs/source/diagnostics/source_b0009) | Content file \<name\> exports `content` by name. Content is now the default export: `export default defineContent({ ... })`. |
| [`SOURCE_B0010`](https://vitehub.dev/docs/source/diagnostics/source_b0010) | defineContent({ seo: { mcp } }) serves its MCP server at \<route\>, and \<other\> answers there too. |

## Errors

| Code | What happened |
| --- | --- |
| [`SOURCE_COLLECTION_ACCESS_CONFLICT`](https://vitehub.dev/docs/source/diagnostics/source_collection_access_conflict) | A Collection cannot set both `access: "public"` and `authorize`. |
| [`SOURCE_COLLECTION_ACCESS_REQUIRED`](https://vitehub.dev/docs/source/diagnostics/source_collection_access_required) | A routed Collection must set authorize or access. Without one, the generated /api route would serve every item to anyone. |
| [`SOURCE_COLLECTION_AUTHORIZE_FALSE`](https://vitehub.dev/docs/source/diagnostics/source_collection_authorize_false) | Collection `authorize: false` does not make a route public. |
| [`SOURCE_COLLECTION_PUBLIC_TRANSFORM_REQUIRED`](https://vitehub.dev/docs/source/diagnostics/source_collection_public_transform_required) | A Collection over table() with `access: "public"` would serve every column of each row, such as password hashes or emails. |

## Named errors

| Code | What happened |
| --- | --- |
| [`SOURCE_GITHUB_ARCHIVE_INVALID`](https://vitehub.dev/docs/source/diagnostics/source_github_archive_invalid) | The archive of the github() Source has an entry with an invalid size. |
| [`SOURCE_GLOB_OPTIONS_NOT_LITERAL`](https://vitehub.dev/docs/source/diagnostics/source_glob_options_not_literal) | glob() here takes options that are not literals, so the build cannot bundle its files. It reads them from disk at runtime, which hosts such as Cloudflare Workers do not have. |

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

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

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