Skip to content

Commit

Permalink
fix unintended early return in cache during server render
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Feb 20, 2024
1 parent 959c353 commit 533b7a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-cooks-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/router": patch
---

fix unintended early return in cache during server render
3 changes: 1 addition & 2 deletions src/data/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ export function cache<T extends (...args: any) => any>(fn: T, name: string): Cac
}
if (isServer) {
const e = getRequestEvent();
e && e.router!.dataOnly && (e.router!.data![key] = res);
return res;
if (e && e.router!.dataOnly) return (e.router!.data![key] = res);
}
if (intent !== "preload") {
res =
Expand Down

0 comments on commit 533b7a0

Please sign in to comment.