From fdae48fda4e31d2aacdb9e6654c768a444726b47 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 21 Dec 2024 12:43:45 -0500 Subject: [PATCH] fix: allow dynamic routes with missing fallback in hash mode (#13213) --- .changeset/four-llamas-join.md | 5 +++++ packages/adapter-static/index.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/four-llamas-join.md diff --git a/.changeset/four-llamas-join.md b/.changeset/four-llamas-join.md new file mode 100644 index 000000000000..d888cd182ec0 --- /dev/null +++ b/.changeset/four-llamas-join.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-static': patch +--- + +fix: allow dynamic routes with missing fallback in hash mode diff --git a/packages/adapter-static/index.js b/packages/adapter-static/index.js index c5e0d68efa42..da57bae89fef 100644 --- a/packages/adapter-static/index.js +++ b/packages/adapter-static/index.js @@ -7,7 +7,7 @@ export default function (options) { name: '@sveltejs/adapter-static', async adapt(builder) { - if (!options?.fallback) { + if (!options?.fallback && builder.config.kit.router.type !== 'hash') { const dynamic_routes = builder.routes.filter((route) => route.prerender !== true); if (dynamic_routes.length > 0 && options?.strict !== false) { const prefix = path.relative('.', builder.config.kit.files.routes);