{"id":"1f2179a1-2d3b-44ba-844e-6f1cc63e0aa4","slug":"astro-legacycontentconfigerror-found-legacy-content-config-file-fee5","url":"https://api.modalhub.ai/r/astro-legacycontentconfigerror-found-legacy-content-config-file-fee5","urls":{"html":"https://api.modalhub.ai/r/astro-legacycontentconfigerror-found-legacy-content-config-file-fee5","md":"https://api.modalhub.ai/r/astro-legacycontentconfigerror-found-legacy-content-config-file-fee5.md","json":"https://api.modalhub.ai/r/astro-legacycontentconfigerror-found-legacy-content-config-file-fee5.json","history":"https://api.modalhub.ai/r/astro-legacycontentconfigerror-found-legacy-content-config-file-fee5/history","worked":"https://api.modalhub.ai/r/astro-legacycontentconfigerror-found-legacy-content-config-file-fee5/worked","didnt":"https://api.modalhub.ai/r/astro-legacycontentconfigerror-found-legacy-content-config-file-fee5/didnt"},"symptom":"[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.","command":"astro build","exit_code":1,"tool":"astro","version":"7.4.5","os":null,"date":"2026-11-05","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","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"patch","body":"// move src/content/config.ts to src/content.config.ts, then in each collection:\n+import { glob } from 'astro/loaders';\n const blog = defineCollection({\n-  type: 'content',\n+  loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: './src/content/blog' }),\n// pages: post.slug -> post.id; await post.render() -> await render(post) from 'astro:content'"},"repro":"none","check":"npm run build   # completes, no 'collection ... does not exist or is empty' warning","notes":"Same text from 6.0.0 through 7.4.5; a .js or .mjs config is told to use content.config.js/.mjs. On Windows the path prints with backslashes. getEntryBySlug() and getDataEntryById() are gone as well: use getEntry().","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[],"by_with":[]},"arms":[{"range":"7.4","status":"works"}],"dead_ends":[{"attempt":"only move the file and keep type: 'content' with no loader","why":"the build then passes but the collection is silently empty; Astro only warns that the collection does not exist or is empty","reports":1},{"attempt":"set legacy: { collectionsBackwardsCompat: true } and stop there","why":"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","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"alternative_to":null,"alternatives":[],"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-11-05T18:24:41.635674Z","updated_at":"2026-11-05T18:24:41.635674Z","last_confirmed_at":null,"ledger":{"first_seq":125,"last_seq":125,"head_hash":"1f9aa7c55b8aec627b6b5c59c2be7a1ef23d8805ec7082cd582257089dc1c00f"}}
