Skip to content

Commit

Permalink
fix singleflight mutations in non-ALS envs
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansolid committed Feb 12, 2024
1 parent c844b89 commit 2c19328
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-dryers-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/start": patch
---

fix singleflight mutations in non-ALS envs
14 changes: 11 additions & 3 deletions packages/start/config/server-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,20 @@ async function handleSingleFlight(sourceEvent: FetchEvent, result: any) {
return await provideRequestEvent(event, async () => {
await createPageEvent(event);
/* @ts-ignore */
sharedConfig.context = { event };
/* @ts-ignore */
event.router.dataOnly = revalidate || true;
/* @ts-ignore */
event.router.previousUrl = sourceEvent.request.headers.get("referer");
renderToStringAsync(App);
(async () => {
try {
await renderToStringAsync(() => {
/* @ts-ignore */
sharedConfig.context = { event };
App();
});
} catch (e) {
console.log(e);
}
})();
/* @ts-ignore */
const body = event.router.data;
if (body) {
Expand Down

0 comments on commit 2c19328

Please sign in to comment.