From 3466287921a88cf0e2cf65d255ccd3fb54a6ec1c Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Thu, 27 Jul 2023 23:34:32 +0800 Subject: [PATCH 1/2] only log dynamic routes instead of all routes --- packages/adapter-static/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/adapter-static/index.js b/packages/adapter-static/index.js index f2db6ae30449..96ccf731dd98 100644 --- a/packages/adapter-static/index.js +++ b/packages/adapter-static/index.js @@ -8,7 +8,8 @@ export default function (options) { async adapt(builder) { if (!options?.fallback) { - if (builder.routes.some((route) => route.prerender !== true) && options?.strict !== false) { + 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); const has_param_routes = builder.routes.some((route) => route.id.includes('[')); const config_option = @@ -22,7 +23,7 @@ export default function (options) { builder.log.error( `@sveltejs/adapter-static: all routes must be fully prerenderable, but found the following routes that are dynamic: -${builder.routes.map((route) => ` - ${path.posix.join(prefix, route.id)}`).join('\n')} +${dynamic_routes.map((route) => ` - ${path.posix.join(prefix, route.id)}`).join('\n')} You have the following options: - set the \`fallback\` option — see https://kit.svelte.dev/docs/single-page-apps#usage for more info. From 15936ef9518bb5a87d57d5501f65e997ee2cb06d Mon Sep 17 00:00:00 2001 From: Tee Ming Date: Thu, 27 Jul 2023 23:35:19 +0800 Subject: [PATCH 2/2] changeset --- .changeset/shy-zoos-sit.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/shy-zoos-sit.md diff --git a/.changeset/shy-zoos-sit.md b/.changeset/shy-zoos-sit.md new file mode 100644 index 000000000000..c33a6fcf813f --- /dev/null +++ b/.changeset/shy-zoos-sit.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-static': patch +--- + +fix: correctly list dynamic routes in error log