Skip to content

Commit

Permalink
fix: injected route entrypoint (#12816)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico authored Jan 2, 2025
1 parent f12f111 commit 7fb2184
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/sour-bananas-rule.md
Original file line number Diff line number Diff line change
@@ -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.
6 changes: 5 additions & 1 deletion packages/astro/src/core/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7fb2184

Please sign in to comment.