Skip to content

Commit 15c2777

Browse files
authored
fix: correctly compare routes (#8952)
1 parent 51cd6e6 commit 15c2777

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.changeset/rich-chefs-refuse.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/adapter-netlify': patch
3+
---
4+
5+
fix: correctly compare routes when generating split functions

packages/adapter-netlify/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,11 @@ async function generate_lambda_functions({ builder, publish, split }) {
213213

214214
// figure out which lower priority routes should be considered fallbacks
215215
for (let j = i + 1; j < builder.routes.length; j += 1) {
216-
if (routes[j].prerender === true) continue;
216+
const other = builder.routes[j];
217+
if (other.prerender === true) continue;
217218

218-
if (matches(route.segments, routes[j].segments)) {
219-
routes.push(builder.routes[j]);
219+
if (matches(route.segments, other.segments)) {
220+
routes.push(other);
220221
}
221222
}
222223

0 commit comments

Comments
 (0)