From d4ab14fe61eaf3f6986d59d3bec817694797102a Mon Sep 17 00:00:00 2001 From: Nic Polumeyv <162764842+Nic-Polumeyv@users.noreply.github.com> Date: Thu, 13 Aug 2026 14:37:05 -0400 Subject: [PATCH 1/2] fix: strip trailing slashes from prerendered paths in edge exclude list --- .changeset/lazy-pugs-refuse.md | 5 +++++ packages/adapter-netlify/index.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/lazy-pugs-refuse.md diff --git a/.changeset/lazy-pugs-refuse.md b/.changeset/lazy-pugs-refuse.md new file mode 100644 index 000000000000..7707628b8902 --- /dev/null +++ b/.changeset/lazy-pugs-refuse.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-netlify': patch +--- + +fix: strip trailing slashes from prerendered paths in the edge function exclude list, so the root page is served statically when using a base path diff --git a/packages/adapter-netlify/index.js b/packages/adapter-netlify/index.js index cd8ff0521324..7c0931e5a996 100644 --- a/packages/adapter-netlify/index.js +++ b/packages/adapter-netlify/index.js @@ -138,7 +138,9 @@ async function generate_edge_functions({ builder }) { // Contains static files `/${builder.getAppPath()}/immutable/*`, `/${builder.getAppPath()}/version.json`, - ...builder.prerendered.paths, + // the root page with a base path and `trailingSlash: 'always'` pages are recorded + // with a trailing slash, which Netlify treats as required rather than optional + ...builder.prerendered.paths.map((path) => (path === '/' ? path : path.replace(/\/$/, ''))), ...Array.from(assets).flatMap((asset) => { if (asset.endsWith('/index.html')) { const dir = asset.replace(/\/index\.html$/, ''); From 9ffcd474664e7bd1682566120db6f708b5a30fe4 Mon Sep 17 00:00:00 2001 From: Nic Polumeyv <162764842+Nic-Polumeyv@users.noreply.github.com> Date: Thu, 13 Aug 2026 14:49:05 -0400 Subject: [PATCH 2/2] shorten comment --- packages/adapter-netlify/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/adapter-netlify/index.js b/packages/adapter-netlify/index.js index 7c0931e5a996..db7d43fea1ef 100644 --- a/packages/adapter-netlify/index.js +++ b/packages/adapter-netlify/index.js @@ -138,8 +138,7 @@ async function generate_edge_functions({ builder }) { // Contains static files `/${builder.getAppPath()}/immutable/*`, `/${builder.getAppPath()}/version.json`, - // the root page with a base path and `trailingSlash: 'always'` pages are recorded - // with a trailing slash, which Netlify treats as required rather than optional + // the base root and `trailingSlash: 'always'` pages are recorded with a trailing slash ...builder.prerendered.paths.map((path) => (path === '/' ? path : path.replace(/\/$/, ''))), ...Array.from(assets).flatMap((asset) => { if (asset.endsWith('/index.html')) {