{"record":{"id":"46c39a4ca5e1692c","repo":"withastro/astro","slug":"livecontentconfigerror-46c39a","errorCode":"LiveContentConfigError","errorMessage":"Collections with type `live` must be defined in a `src/live.config.ts` file. Check your collection definitions in your live content config file.","messagePattern":"Collections with type `live` must be defined in a `src/live\\.config\\.ts` file\\. Check your collection definitions in your live content config file\\.","errorType":"error_code","errorClass":"AstroError","httpStatus":null,"severity":"error","filePath":"packages/astro/src/content/runtime.ts","lineNumber":803,"sourceCode":"\t\t\t});\n\t};\n}\n\ntype PropagatedAssetsModule = {\n\t__astroPropagation: true;\n\tgetMod: () => Promise<any>;\n\tcollectedStyles: string[];\n\tcollectedLinks: string[];\n\tcollectedScripts: string[];\n};\n\nfunction isPropagatedAssetsModule(module: any): module is PropagatedAssetsModule {\n\treturn typeof module === 'object' && module != null && '__astroPropagation' in module;\n}\n\nexport function defineCollection(config: any) {\n\tif (config.type === 'live') {\n\t\tthrow new AstroError({\n\t\t\t...AstroErrorData.LiveContentConfigError,\n\t\t\tmessage: AstroErrorData.LiveContentConfigError.message(\n\t\t\t\t'Collections with type `live` must be defined in a `src/live.config.ts` file.',\n\t\t\t),\n\t\t});\n\t}\n\treturn defineCollectionOrig(config);\n}\n\nexport function defineLiveCollection() {\n\tthrow new AstroError({\n\t\t...AstroErrorData.LiveContentConfigError,\n\t\tmessage: AstroErrorData.LiveContentConfigError.message(\n\t\t\t'Live collections must be defined in a `src/live.config.ts` file.',\n\t\t),\n\t});\n}\n","sourceCodeStart":785,"sourceCodeEnd":821,"githubUrl":"https://github.com/withastro/astro/blob/e294953aa8aadd98d5be92e60a03037b05dbdfd4/packages/astro/src/content/runtime.ts#L785-L821","documentation":"defineCollection() exported from astro:content (the helper for src/content.config.ts) rejects configs with type: 'live'. Live collections use a separate config surface — src/live.config.ts with defineLiveCollection — because they require a loader, schema, and optional proxy setup rather than regular collection options, and Astro fails fast when the two are mixed.","triggerScenarios":"Writing defineCollection({ type: 'live', ... }) inside src/content.config.ts; copying a live-collections documentation example into the wrong config file.","commonSituations":"Adopting live collections in Astro 5.x and pasting the example into content.config.ts out of habit; migrating a project incrementally and mixing both config styles in one file.","solutions":["Move the live collection definition into src/live.config.ts.","Define it there with defineLiveCollection({ loader, schema }) instead of defineCollection.","Keep regular (non-live) collections in src/content.config.ts and import types from astro:content in that file.","Run astro sync (or restart the dev server) so the new config file is picked up."],"exampleFix":"// before: src/content.config.ts\nimport { defineCollection } from 'astro:content';\nexport const collections = {\n  docs: defineCollection({ type: 'live', loader, schema }),\n};\n\n// after: src/live.config.ts\nimport { defineLiveCollection } from 'astro:content';\nexport const collections = {\n  docs: defineLiveCollection({ loader, schema }),\n};","handlingStrategy":"validation","validationCode":"// Keep the two config surfaces separate: content.config.ts must not see type: 'live'\nimport { readFileSync } from 'node:fs';\nconst src = readFileSync('src/content.config.ts', 'utf8');\nif (src.includes(\"type: 'live'\") || src.includes('type: \"live\"')) {\n  throw new Error('live collections belong in src/live.config.ts');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create src/live.config.ts as soon as you adopt live collections; keep the files purpose-built.","Import defineLiveCollection only in src/live.config.ts and defineCollection only in src/content.config.ts.","Run astro sync after adding collections to catch config-shape mistakes immediately."],"tags":["live-collections","content-config","configuration"],"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"}