Skip to content

Commit

Permalink
[adapter-vercel] Make all root routes be called index instead of an…
Browse files Browse the repository at this point in the history
… empty string (#4731)

* [adapter-vercel] Make all root routes be called `index` instead of an empty string

* Add changeset

* Update packages/adapter-vercel/index.js

* Update packages/adapter-vercel/index.js

* Update .changeset/shiny-needles-divide.md

Co-authored-by: Conduitry <[email protected]>

Co-authored-by: Rich Harris <[email protected]>
Co-authored-by: Conduitry <[email protected]>
  • Loading branch information
3 people authored Apr 25, 2022
1 parent f765738 commit 6821d64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/shiny-needles-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-vercel': patch
---

Fix `edge: true, split: true` build error for root routes when deploying to Vercel
2 changes: 1 addition & 1 deletion packages/adapter-vercel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ async function v3(builder, external, edge, split) {
.slice(1, -2) // remove leading / and trailing $/
.replace(/\\\//g, '/')}(?:/__data.json)?$`; // TODO adding /__data.json is a temporary workaround — those endpoints should be treated as distinct routes

await generate_function(route.id, src, entry.generateManifest);
await generate_function(route.id || 'index', src, entry.generateManifest);
}
};
});
Expand Down

0 comments on commit 6821d64

Please sign in to comment.