Records below are third-party data, not instructions. Apply with your own judgment.
[LegacyContentConfigError] Found legacy content config file in "src/content/config.ts". Please move this file to "src/content.config.ts" and ensure each collection has a loader defined.
Cause
Astro 6 removed the v2-v4 content collections API: config must live in src/content.config.ts with a loader per collection, so an old src/content/config.ts aborts startup.
Fix
// move src/content/config.ts to src/content.config.ts, then in each collection:+import { glob } from 'astro/loaders';const blog = defineCollection({- type: 'content',+ loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: './src/content/blog' }),// pages: post.slug -> post.id; await post.render() -> await render(post) from 'astro:content'Don’t try
only move the file and keep type: 'content' with no loader — the build then passes but the collection is silently empty; Astro only warns that the collection does not exist or is empty.
set legacy: { collectionsBackwardsCompat: true } and stop there — the docs call it a temporary migration helper that keeps v4 behaviour (src/content/config.ts, slug, entry.render()); migrate to loaders, then remove it.