{"record":{"id":"703a8665dc558e4a","repo":"withastro/astro","slug":"content-config-not-loaded","errorCode":null,"errorMessage":"Content config not loaded","messagePattern":"Content config not loaded","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/astro/src/core/dev/dev.ts","lineNumber":130,"sourceCode":"\t\tattachDataStoreInvalidation(store, restart.container.viteServer, restart.container.settings);\n\t}\n\tawait attachContentServerListeners(restart.container);\n\n\tconst config = globalContentConfigObserver.get();\n\tif (config.status === 'error') {\n\t\tlogger.error('content', config.error.message);\n\t}\n\tif (config.status === 'loaded' && store) {\n\t\tconst contentLayer = globalContentLayer.init({\n\t\t\tsettings: restart.container.settings,\n\t\t\tlogger,\n\t\t\twatcher: restart.container.viteServer.watcher,\n\t\t\tstore,\n\t\t});\n\t\tcontentLayer.watchContentConfig();\n\t\tawait contentLayer.sync();\n\t} else if (config.status !== 'does-not-exist') {\n\t\tlogger.warn('content', 'Content config not loaded');\n\t}\n\n\t// Start listening to the port\n\tconst devServerAddressInfo = await startContainer(restart.container);\n\n\trestart.bindCLIShortcuts();\n\tlogger.info(\n\t\t'SKIP_FORMAT',\n\t\tmsg.serverStart({\n\t\t\tstartupTime: performance.now() - devStart,\n\t\t\tresolvedUrls: restart.container.viteServer.resolvedUrls || { local: [], network: [] },\n\t\t\thost: restart.container.settings.config.server.host,\n\t\t\tbase: restart.container.settings.config.base,\n\t\t\tastroVersionProvider: new BuildTimeAstroVersionProvider(),\n\t\t\ttextStyler: piccoloreTextStyler,\n\t\t}),\n\t);\n","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/withastro/astro/blob/e294953aa8aadd98d5be92e60a03037b05dbdfd4/packages/astro/src/core/dev/dev.ts#L112-L148","documentation":"On dev start/restart, Astro loads src/content.config.ts into a status of loaded, does-not-exist, or error. When the file exists but did not load cleanly, the content layer is not started; the actual error is printed just above via logger.error('content', ...), and this warning summarizes that no content config is active for this session.","triggerScenarios":"A syntax error, invalid export shape, or failed import (e.g. a loader or zod package not installed) in src/content.config.ts leaves status !== 'loaded' and !== 'does-not-exist' — commonly a transient broken state while the dev server auto-restarts mid-edit.","commonSituations":"Saving a half-finished edit to content.config.ts; adding an import for a package that is not installed; TypeScript-only failures like importing types without type annotations.","solutions":["Scroll up to the logger.error('content', ...) line — it contains the real cause (syntax error, missing module, etc.)","Fix src/content.config.ts and make sure every imported package is installed","Save the file to trigger a dev-server restart; the content layer re-syncs automatically"],"exampleFix":"// before — src/content.config.ts (broken import)\nimport { glob } from 'astro/loader'; // typo: package is 'astro/loaders'\nexport const collections = { blog: { loader: glob({ pattern: '**/*.md' }) } };\n\n// after\nimport { defineCollection } from 'astro:content';\nimport { glob } from 'astro/loaders';\n\nconst blog = defineCollection({\n  loader: glob({ pattern: '**/*.md', base: './src/content/blog' }),\n});\nexport const collections = { blog };","handlingStrategy":"validation","validationCode":"// surface content.config.ts load errors before starting the app\ntry {\n  await import('./src/content.config.ts');\n} catch (e) {\n  console.error('content.config.ts failed to load:', e.message);\n  process.exitCode = 1;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install every package imported by content.config.ts before committing","Keep the content config small and typed; run `astro check`/tsc on it in CI","When this warning appears, always read the logger.error line printed directly above it"],"tags":["content-collections","config","dev-server"],"backgroundTag":"config-file-load-failed","analyzedSha":"e294953aa8aadd98d5be92e60a03037b05dbdfd4","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}