Skip to content

Commit e9e8080

Browse files
authoredOct 21, 2024··
Add server island route to the front of the route list (#12263)
* Add server island route to the front of the route list * Add changeset
1 parent 388d237 commit e9e8080

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed
 

‎.changeset/honest-dots-jump.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'astro': patch
3+
---
4+
5+
Fixes conflict between server islands and on-demand dynamic routes in the form of `/[...rest]` or `/[paramA]/[paramB]`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
export const prerender = false;
3+
---
4+
5+
<html>
6+
<head>
7+
<title>Conflicting route</title>
8+
</head>
9+
<body>
10+
This route would conflict with the route generated for server islands.
11+
<br />
12+
This file is here so the tests break if that happens.
13+
</body>
14+
</html>

‎packages/astro/src/core/server-islands/endpoint.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function ensureServerIslandRoute(config: ConfigFields, routeManifest: Man
4444
return;
4545
}
4646

47-
routeManifest.routes.push(getServerIslandRouteData(config));
47+
routeManifest.routes.unshift(getServerIslandRouteData(config));
4848
}
4949

5050
type RenderOptions = {

0 commit comments

Comments
 (0)
Please sign in to comment.