withastro/astro · info

Skipped the following files that matched ${colors.green(patt

Error message

Skipped the following files that matched ${colors.green(patternList)}:

What it means

Header line of the legacy-mode skip report: when legacy collections are enabled and the glob() loader skipped 10 or fewer files inside src/content, Astro logs this message naming the matched pattern, then lists each skipped file on its own bulleted line. The files are not ingested by the content layer.

Source

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

				}),
			);

			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

View on GitHub (pinned to e294953aa8)

Solutions

  1. Move each listed file out of src/content (e.g. to src/data/<collection>/) and update the glob base
  2. Or finish the migration and disable legacy.collectionsBackwardsCompat
  3. Delete files from the list that are no longer needed
Defensive patterns

Strategy: validation

Validate before calling

// Fail fast if any file under src/content would be skipped in legacy mode
import { glob } from 'tinyglobby';
const skipped = await glob(pattern, { cwd: new URL(base, projectRoot) });
const inSrcContent = skipped.filter((f) => f.startsWith('src/content'));
if (legacyEnabled && inSrcContent.length > 0) {
  throw new Error(`These files will be skipped by the glob loader: ${inSrcContent.join(', ')}`);
}

Prevention

When it happens

Trigger: legacy.collectionsBackwardsCompat enabled, a glob collection whose base covers src/content, and between 1 and 10 matched files skipped.

Common situations: Small collections or a handful of stray files left under src/content during an incremental migration to the Content Layer.

Related errors


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