diff --git a/.changeset/sour-bananas-rule.md b/.changeset/sour-bananas-rule.md new file mode 100644 index 000000000000..7e8af13d68e4 --- /dev/null +++ b/.changeset/sour-bananas-rule.md @@ -0,0 +1,7 @@ +--- +'astro': patch +--- + +Fixes an issue where an injected route entrypoint wasn't correctly marked because the resolved file path contained a query parameter. + +This fixes some edge case where some injected entrypoint were not resolved when using an adapter. diff --git a/packages/astro/src/core/util.ts b/packages/astro/src/core/util.ts index f0447529a91a..dd663de83952 100644 --- a/packages/astro/src/core/util.ts +++ b/packages/astro/src/core/util.ts @@ -115,7 +115,11 @@ function isInPagesDir(file: URL, config: AstroConfig): boolean { function isInjectedRoute(file: URL, settings: AstroSettings) { let fileURL = file.toString(); for (const route of settings.resolvedInjectedRoutes) { - if (route.resolvedEntryPoint && fileURL === route.resolvedEntryPoint.toString()) return true; + if ( + route.resolvedEntryPoint && + removeQueryString(fileURL) === removeQueryString(route.resolvedEntryPoint.toString()) + ) + return true; } return false; }