Skip to content

Commit 760c9a9

Browse files
authored
fix(website): fix build by fixing tiny router typing issues (#12)
1 parent 42fd556 commit 760c9a9

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

apps/website/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
"@ilha/router": ["../../packages/router/src/index.ts"],
2626
"@ilha/router/vite": ["../../packages/router/src/vite.ts"]
2727
}
28-
}
28+
},
29+
"exclude": ["../../packages"]
2930
}

packages/router/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ export function prefetch(pathWithSearch: string): void {
335335
if (!isBrowser) return;
336336
if (prefetchCache.has(pathWithSearch)) return;
337337
// Don't prefetch routes that have no loader — nothing to fetch.
338-
const pathOnly = pathWithSearch.split("?")[0];
338+
const pathOnly = pathWithSearch.split("?")[0] ?? "";
339339
const match = findRoute(_rou3, "GET", pathOnly);
340340
if (!match?.data?.loader) return;
341341
const promise = fetchLoaderData(pathWithSearch).catch((e) => {
@@ -369,7 +369,7 @@ async function mountRouteWithHydration(
369369
// Fetch loader data *only if* the matched route has a loader registered.
370370
// Routes registered client-side have `loader: undefined` when the Vite
371371
// plugin emits server-only loader imports behind `import.meta.env.SSR`.
372-
const clientMatch = findRoute(_rou3, "GET", pathWithSearch.split("?")[0]);
372+
const clientMatch = findRoute(_rou3, "GET", pathWithSearch.split("?")[0] ?? "");
373373
const hasLoader = !!clientMatch?.data?.loader;
374374

375375
let props: Record<string, unknown> = {};

0 commit comments

Comments
 (0)