withastro/astro · info

• ${colors.green(file)}

Error message

• ${colors.green(file)}

What it means

Individual bullet of the legacy-mode skip report: one line per file the glob() loader skipped because it lives in src/content while legacy collections mode is enabled. Read together with the header line, these bullets are the exact set of files the content layer refused to ingest.

Source

Thrown at packages/astro/src/content/loaders/glob.ts:348

			);

			const skipCount = skippedFiles.length;

			if (skipCount > 0) {
				const patternList = Array.isArray(globOptions.pattern)
					? globOptions.pattern.join(', ')
					: globOptions.pattern;

				logger.warn(
					`The glob() loader cannot be used for files in ${colors.bold('src/content')} when legacy mode is enabled.`,
				);
				if (skipCount > 10) {
					logger.warn(
						`Skipped ${colors.green(skippedFiles.length)} files that matched ${colors.green(patternList)}.`,
					);
				} else {
					logger.warn(`Skipped the following files that matched ${colors.green(patternList)}:`);
					skippedFiles.forEach((file) => logger.warn(`• ${colors.green(file)}`));
				}
			}

			// Remove entries that were not found this time
			untouchedEntries.forEach((id) => store.delete(id));

			if (!watcher) {
				return;
			}

			watcher.add(filePath);

			// Split negation patterns out and pass them as picomatch's `ignore` option
			// so watcher filtering matches tinyglobby's semantics (set subtraction),
			// not picomatch's default (any-match union). See #17484.
			const patterns = Array.isArray(globOptions.pattern)
				? globOptions.pattern
				: [globOptions.pattern];

View on GitHub (pinned to e294953aa8)

Solutions

  1. For each listed file: move it into the content-layer source directory (e.g. src/data/<collection>/)
  2. Or remove the file if obsolete
  3. Once the list is empty and migration is done, disable legacy.collectionsBackwardsCompat
Defensive patterns

Strategy: validation

Validate before calling

// Enumerate exactly which files the content layer will skip, per the bullet list
import { glob } from 'tinyglobby';
function filesLegacyWillSkip(pattern: string | string[], baseDir: string, legacy: boolean): string[] {
  if (!legacy) return [];
  return glob.sync(pattern as string, { cwd: baseDir }).filter((f) => baseDir.includes('/src/content'));
}

Prevention

When it happens

Trigger: Each file under src/content matched by a glob pattern while legacy.collectionsBackwardsCompat is true and the skip count is 10 or fewer.

Common situations: Identifying precisely which markdown/data files a half-finished migration left behind under src/content.

Related errors


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