withastro/astro · warning

No entry type found for ${entry}

Error message

No entry type found for ${entry}

What it means

A file matched the glob() loader's pattern, but its extension is not registered as a content or data entry type (built-ins like .md, .json, .yaml, plus types registered by integrations such as @astrojs/mdx for .mdx). syncData() bails out with this warning and the file is not ingested into the collection.

Source

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

			parseData,
			store,
			generateDigest,
			entryTypes,
		}) => {
			const renderFunctionByContentType = new WeakMap<
				ContentEntryType,
				ContentEntryRenderFunction
			>();

			const untouchedEntries = new Set(store.keys());
			async function syncData(
				entry: string,
				base: URL,
				entryType?: ContentEntryType,
				oldId?: string,
			) {
				if (!entryType) {
					logger.warn(`No entry type found for ${entry}`);
					return;
				}
				const fileUrl = new URL('./' + encodeURI(entry), base);
				const contents = await fs.readFile(fileUrl, 'utf-8').catch((err) => {
					logger.error(`Error reading ${entry}: ${err.message}`);
					return;
				});

				if (!contents && contents !== '') {
					logger.warn(`No contents found for ${entry}`);
					return;
				}

				const { body, data } = await entryType.getEntryInfo({
					contents,
					fileUrl,
				});

View on GitHub (pinned to e294953aa8)

Solutions

  1. Narrow the glob pattern to supported extensions, e.g. '**/*.md' or ['**/*.md', '**/*.mdx']
  2. Install and enable the integration that registers the entry type (e.g. @astrojs/mdx for .mdx)
  3. If you need a custom format, register a ContentEntryType/DataEntryType from an integration

Example fix

// before: src/content.config.ts
const blog = defineCollection({ loader: glob({ pattern: '**/*', base: './src/data/blog' }) });

// after
const blog = defineCollection({ loader: glob({ pattern: ['**/*.md', '**/*.mdx'], base: './src/data/blog' }) });
Defensive patterns

Strategy: type-guard

Validate before calling

// Derive glob patterns from the extensions you actually support instead of '**/*'
const SUPPORTED_EXTENSIONS = ['.md', '.mdx', '.json', '.yaml', '.yml'] as const;
const pattern = SUPPORTED_EXTENSIONS.map((ext) => `**/*${ext}`);

Type guard

type ContentFile = `${string}.${'md' | 'mdx' | 'json' | 'yaml' | 'yml'}`;
const REGISTERED_EXTENSIONS = new Set(['.md', '.mdx', '.json', '.yaml', '.yml']);
function hasRegisteredEntryType(file: string): file is ContentFile {
  const dot = file.lastIndexOf('.');
  return dot !== -1 && REGISTERED_EXTENSIONS.has(file.slice(dot));
}

Prevention

When it happens

Trigger: A broad pattern like '**/*' matching .txt/.csv/.asset files; referencing .mdx files without the MDX integration installed or enabled; a custom entry type from an integration that is not loaded in this project.

Common situations: Widening patterns from '**/*.md' to '**/*' and catching stray files; adding notes/draft files with unusual extensions into a content directory; forgetting to run astro add mdx before using .mdx entries.

Related errors


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