{"record":{"id":"349b322ff09ed3e4","repo":"withastro/astro","slug":"livecontentconfigerror-349b32","errorCode":"LiveContentConfigError","errorMessage":"Live collections must be defined in a `src/live.config.ts` file. Check your collection definitions in ${filename}.","messagePattern":"Live collections must be defined in a `src/live\\.config\\.ts` file\\. Check your collection definitions in (.+?)\\.","errorType":"error_code","errorClass":"AstroError","httpStatus":null,"severity":"error","filePath":"packages/astro/src/content/utils.ts","lineNumber":528,"sourceCode":"\n\tconst config = contentConfigParser.safeParse(unparsedConfig);\n\tif (config.success) {\n\t\t// Generate a digest of the config file so we can invalidate the cache if it changes\n\t\tconst hasher = await xxhash();\n\t\tconst digest = hasher.h64ToString(await fs.promises.readFile(configPathname, 'utf-8'));\n\t\treturn { ...config.data, digest };\n\t} else {\n\t\tconst message = config.error.issues\n\t\t\t.map((issue) => `  → ${colors.green(issue.path.join('.'))}: ${colors.red(issue.message)}`)\n\t\t\t.join('\\n');\n\t\tconsole.error(\n\t\t\t`${colors.green('[content]')} There was a problem with your content config:\\n\\n${message}\\n`,\n\t\t);\n\t\tconst liveCollections = Object.entries(unparsedConfig.collections ?? {}).filter(\n\t\t\t([, collection]: [string, any]) => collection?.type === LIVE_CONTENT_TYPE,\n\t\t);\n\t\tif (liveCollections.length > 0) {\n\t\t\tthrow new AstroError({\n\t\t\t\t...AstroErrorData.LiveContentConfigError,\n\t\t\t\tmessage: AstroErrorData.LiveContentConfigError.message(\n\t\t\t\t\t'Live collections must be defined in a `src/live.config.ts` file.',\n\t\t\t\t\tpath.relative(fileURLToPath(settings.config.root), configPathname),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\t\treturn undefined;\n\t}\n}\n\nasync function autogenerateCollections({\n\tconfig,\n\tsettings,\n\tfs,\n}: {\n\tconfig?: ContentConfig;\n\tsettings: AstroSettings;","sourceCodeStart":510,"sourceCodeEnd":546,"githubUrl":"https://github.com/withastro/astro/blob/d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca/packages/astro/src/content/utils.ts#L510-L546","documentation":"Thrown when the content config (`src/content.config.*`) fails Zod validation AND at least one collection in that file has `type: 'live'`. Live collections must be defined in `src/live.config.ts`, not in the regular content config. The error fires only as a secondary, more helpful message on top of the config parse failure — the code first prints the parse errors to stderr, then checks if live collections are the likely culprit.","triggerScenarios":"A developer defines a collection with `type: 'live'` inside `src/content.config.ts` (or `.js`/`.mjs`). The content config parser rejects the config, the code detects live collections among the unparsed definitions, and throws this error pointing to the offending file.","commonSituations":"Following a tutorial that shows live collections without clarifying the file split. Upgrading Astro and trying the new live collections feature in the existing config file. Copying a live collection example into `content.config.ts` instead of `live.config.ts`.","solutions":["Create `src/live.config.ts` and move all live collection definitions there.","Remove `type: 'live'` collections from `src/content.config.ts` entirely.","Keep regular (non-live) collections in `src/content.config.ts`.","Re-run `astro dev` or `astro build` to confirm the error is gone."],"exampleFix":"// before — src/content.config.ts\nimport { defineCollection } from 'astro:content';\nconst blog = defineCollection({ type: 'live', loader: myLoader });\nexport const collections = { blog };\n\n// after — src/live.config.ts\nimport { defineLiveCollection } from 'astro:content';\nconst blog = defineLiveCollection({ loader: myLoader });\nexport const collections = { blog };","handlingStrategy":"validation","validationCode":"// Check your content config before build\nimport { readFileSync } from 'fs';\nconst config = readFileSync('src/content.config.ts', 'utf-8');\nif (config.includes(\"type: 'live'\") || config.includes('type: \"live\"')) {\n  console.error('Live collections must be in src/live.config.ts');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep live collections in src/live.config.ts and regular collections in src/content.config.ts.","Document the file split for your team.","Run astro build in CI to catch config errors early."],"tags":["content-collections","live-collections","config","zod"],"backgroundTag":null,"analyzedSha":"d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca","analyzedAt":"2026-08-12T13:37:29.035Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}