Skip to content

Commit

Permalink
Add server island route to the front of the route list (#12263)
Browse files Browse the repository at this point in the history
* Add server island route to the front of the route list

* Add changeset
  • Loading branch information
Fryuni authored Oct 21, 2024
1 parent 388d237 commit e9e8080
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/honest-dots-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes conflict between server islands and on-demand dynamic routes in the form of `/[...rest]` or `/[paramA]/[paramB]`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
export const prerender = false;
---

<html>
<head>
<title>Conflicting route</title>
</head>
<body>
This route would conflict with the route generated for server islands.
<br />
This file is here so the tests break if that happens.
</body>
</html>
2 changes: 1 addition & 1 deletion packages/astro/src/core/server-islands/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function ensureServerIslandRoute(config: ConfigFields, routeManifest: Man
return;
}

routeManifest.routes.push(getServerIslandRouteData(config));
routeManifest.routes.unshift(getServerIslandRouteData(config));
}

type RenderOptions = {
Expand Down

0 comments on commit e9e8080

Please sign in to comment.