Skip to content

Commit 78a6297

Browse files
committed
chore: Add fallback for empty discovery results.
1 parent 8ef548d commit 78a6297

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/start-plugin-core/src/prerender.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ export async function prerender({
2424
// If prerender is enabled but no pages are provided, try to discover static paths
2525
if (startConfig.prerender?.enabled && !startConfig.pages.length) {
2626
try {
27-
startConfig.pages = globalThis.TSS_PRERENDABLE_PATHS
27+
startConfig.pages = globalThis.TSS_PRERENDABLE_PATHS
28+
if (!startConfig.pages.length) {
29+
logger.warn('No static paths discovered. Falling back to root "/"')
30+
startConfig.pages = [{ path: '/' }]
31+
}
2832
} catch (error) {
2933
logger.warn('Failed to get static paths:', error)
3034
startConfig.pages = [{ path: '/' }]

0 commit comments

Comments
 (0)