withastro/astro · error

Auto-generating collections for folders in "src/content/" th

Error message

Auto-generating collections for folders in "src/content/" that are not defined as collections.
This is deprecated, so you should define these collections yourself in "src/content.config.ts".
The following collections have been auto-generated: ${orphanedCollections.map((name) => colors.green(name)).join(', ')}

What it means

Error "Auto-generating collections for folders in "src/content/" that are not defined as collections. This is deprecated, so you should define these collections yourself in "src/content.config.ts". The following collections have been auto-generated: ${orphanedCollections.map((name) => colors.green(name)).join(', ')}" thrown in withastro/astro.

Source

Thrown at packages/astro/src/content/utils.ts:619

				continue;
			}

			if (entry.isDirectory() && !(collectionName in collections)) {
				orphanedCollections.push(collectionName);
				const base = new URL(`${collectionName}/`, contentDir);
				collections[collectionName] = {
					type: CONTENT_LAYER_TYPE,
					loader: glob({
						base,
						pattern: contentPattern,
						[secretLegacyFlag]: true,
					}) as any,
				};
			}
		}

		if (orphanedCollections.length > 0) {
			logger.warn(
				'SKIP_FORMAT',
				`
Auto-generating collections for folders in "src/content/" that are not defined as collections.
This is deprecated, so you should define these collections yourself in "src/content.config.ts".
The following collections have been auto-generated: ${orphanedCollections
					.map((name) => colors.green(name))
					.join(', ')}\n`,
			);
		}
	}

	return { ...config, collections };
}

export async function reloadContentConfigObserver({
	observer = globalContentConfigObserver,
	...loadContentConfigOpts
}: {

View on GitHub (pinned to e294953aa8)

Solutions

  1. Define every folder under src/content/ explicitly as a collection in src/content.config.ts using the glob() file loader
  2. Move non-collection content out of src/content/ (e.g. to src/data/) so it is not auto-adopted
  3. After defining collections manually, remove any reliance on the deprecated auto-generation behavior
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/astro/src/content/utils.ts:619 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of withastro/astro@e294953aa8 (2026-09-09). Data as JSON: /api/errors/060314ab61549a77. Report an issue: GitHub.