From 739fd64d2cf4ecef6d69ff19dc6408524dcb40a6 Mon Sep 17 00:00:00 2001 From: GingerAdonis <2751672+GingerAdonis@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:55:07 +0200 Subject: [PATCH 1/5] fix: `trailing-slash-server` tests do not fully utilize the server This will cause tests to fail. --- .../trailing-slash-server/always/{+page.js => +page.server.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/always/{+page.js => +page.server.js} (100%) diff --git a/packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/always/+page.js b/packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/always/+page.server.js similarity index 100% rename from packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/always/+page.js rename to packages/kit/test/apps/basics/src/routes/routing/trailing-slash-server/always/+page.server.js From b402700458bc4499b13b2861d7903e4a3c3ca6fc Mon Sep 17 00:00:00 2001 From: GingerAdonis <2751672+GingerAdonis@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:55:22 +0200 Subject: [PATCH 2/5] fix: load trailing slash option from server when server has no load function --- packages/kit/src/core/postbuild/analyse.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/kit/src/core/postbuild/analyse.js b/packages/kit/src/core/postbuild/analyse.js index a78924d72221..a69127fc1a67 100644 --- a/packages/kit/src/core/postbuild/analyse.js +++ b/packages/kit/src/core/postbuild/analyse.js @@ -60,7 +60,8 @@ async function analyse({ manifest_path, env }) { const node = await loader(); metadata.nodes[node.index] = { - has_server_load: node.server?.load !== undefined + has_server_load: + node.server?.load !== undefined || node.server?.trailingSlash !== undefined }; } From d627d4e3add6fb070d4c831acaeffff5e1b0e555 Mon Sep 17 00:00:00 2001 From: GingerAdonis <2751672+GingerAdonis@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:55:26 +0200 Subject: [PATCH 3/5] Changeset --- .changeset/pink-sloths-join.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pink-sloths-join.md diff --git a/.changeset/pink-sloths-join.md b/.changeset/pink-sloths-join.md new file mode 100644 index 000000000000..9d72c56828fc --- /dev/null +++ b/.changeset/pink-sloths-join.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +fix: load trailing slash option from server even when there's no load function From 2930914e31ef520f735537eaaaeef4ca4e6ad87a Mon Sep 17 00:00:00 2001 From: GingerAdonis <2751672+GingerAdonis@users.noreply.github.com> Date: Thu, 10 Aug 2023 15:55:26 +0200 Subject: [PATCH 4/5] Changeset --- .changeset/pink-sloths-join.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pink-sloths-join.md diff --git a/.changeset/pink-sloths-join.md b/.changeset/pink-sloths-join.md new file mode 100644 index 000000000000..9d72c56828fc --- /dev/null +++ b/.changeset/pink-sloths-join.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +fix: load trailing slash option from server even when there's no load function From 01912ea277d0f0d5eb40c39d2cd67aac0cd60bc5 Mon Sep 17 00:00:00 2001 From: GingerAdonis <2751672+GingerAdonis@users.noreply.github.com> Date: Fri, 11 Aug 2023 09:22:05 +0200 Subject: [PATCH 5/5] fix: load trailing slash option from server even when there's no load function --- packages/kit/src/core/postbuild/analyse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kit/src/core/postbuild/analyse.js b/packages/kit/src/core/postbuild/analyse.js index a78924d72221..e66b48b9b5e7 100644 --- a/packages/kit/src/core/postbuild/analyse.js +++ b/packages/kit/src/core/postbuild/analyse.js @@ -60,7 +60,7 @@ async function analyse({ manifest_path, env }) { const node = await loader(); metadata.nodes[node.index] = { - has_server_load: node.server?.load !== undefined + has_server_load: node.server?.load !== undefined || node.server?.trailingSlash !== undefined }; }