{"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 ${path.relative(fileURLToPath(settings.config.root), configPathname)}.","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":532,"sourceCode":"\tconst configPathname = fileURLToPath(contentPaths.config.url);\n\tconst unparsedConfig = await environment.runner.import(configPathname);\n\n\tconst config = contentConfigParser(logger).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\tlogger.error('content', `There was a problem with your content config:\\n\\n${message}\\n`);\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\tlogger,\n}: {\n\tconfig?: ContentConfig;","sourceCodeStart":514,"sourceCodeEnd":550,"githubUrl":"https://github.com/withastro/astro/blob/e294953aa8aadd98d5be92e60a03037b05dbdfd4/packages/astro/src/content/utils.ts#L514-L550","documentation":"Astro validates your content config with zod on load. When validation fails and at least one collection in the invalid config has type: 'live', Astro throws this variant of LiveContentConfigError naming the config file — type: 'live' is not part of the content config schema, so its presence is the likely reason validation failed.","triggerScenarios":"Exporting a collections object from src/content.config.ts where any collection has type: 'live'; re-exporting live collection definitions into the content config from a shared module.","commonSituations":"Following live-collections docs and defining them in the wrong file; splitting config across multiple files and merging them back into one export.","solutions":["Move all type: 'live' collections out of the file named in the error into src/live.config.ts, switching them to defineLiveCollection.","Review the zod issues printed just above the throw — they list every invalid property in the config.","Re-run astro sync or restart the dev server to re-validate."],"exampleFix":"// before: src/content.config.ts exports a live collection\nexport const collections = {\n  news: { type: 'live', loader },\n};\n\n// after: src/live.config.ts\nimport { defineLiveCollection } from 'astro:content';\nexport const collections = {\n  news: defineLiveCollection({ loader }),\n};","handlingStrategy":"validation","validationCode":"// CI guard: content.config.ts must not export collections with type: 'live'\n// simplest form: forbid the literal in the file\nimport { readFileSync } from 'node:fs';\nif (/type:\\s*['\"]live['\"]/.test(readFileSync('src/content.config.ts', 'utf8'))) {\n  throw new Error('live collections must move to src/live.config.ts');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep live collections in src/live.config.ts from day one.","Read the zod issue list printed above the error — it pinpoints every invalid property.","Run astro sync locally before pushing config changes."],"tags":["live-collections","content-config","configuration","zod"],"backgroundTag":"config-in-wrong-location","analyzedSha":"e294953aa8aadd98d5be92e60a03037b05dbdfd4","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}