Skip to content

Commit

Permalink
fix ssr without router
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Dec 17, 2023
1 parent 202efe5 commit cfbb6dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/start/server/StartServer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function StartServer(props: { document: Component<DocumentComponentProps>
let assets = [];
Promise.resolve().then(async () => {
let current = context.routes;
if (context.routerMatches[0]) {
if (context.routerMatches && context.routerMatches[0]) {
for (let i = 0; i < context.routerMatches[0].length; i++) {
const match = context.routerMatches[0][i];
if (match.metadata && match.metadata.filesystem) {
Expand All @@ -41,7 +41,7 @@ export function StartServer(props: { document: Component<DocumentComponentProps>
);
});

useAssets(() => assets.map(m => renderAsset(m)));
useAssets(() => assets.length ? assets.map(m => renderAsset(m)) : undefined);

return (
<NoHydration>
Expand Down

0 comments on commit cfbb6dd

Please sign in to comment.