diff --git a/.changeset/hip-bottles-hide.md b/.changeset/hip-bottles-hide.md new file mode 100644 index 000000000000..d8564ab649e9 --- /dev/null +++ b/.changeset/hip-bottles-hide.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Added warning message when using unsupported file extensions in pages/ diff --git a/packages/astro/src/core/routing/manifest/create.ts b/packages/astro/src/core/routing/manifest/create.ts index 47282210990a..51f495e8b468 100644 --- a/packages/astro/src/core/routing/manifest/create.ts +++ b/packages/astro/src/core/routing/manifest/create.ts @@ -229,6 +229,8 @@ export function createRouteManifest( const localFs = fsMod ?? nodeFs; const isPrenderDefault = isHybridOutput(settings.config); + const foundInvalidFileExtensions: Set = new Set(); + function walk( fs: typeof nodeFs, dir: string, @@ -252,6 +254,11 @@ export function createRouteManifest( } // filter out "foo.astro_tmp" files, etc if (!isDir && !validPageExtensions.has(ext) && !validEndpointExtensions.has(ext)) { + if (!foundInvalidFileExtensions.has(ext)) { + foundInvalidFileExtensions.add(ext); + warn(logging, 'astro', `Invalid file extension for Pages: ${ext}`); + } + return; } const segment = isDir ? basename : name;