Add request cookie to HMR reload pipeline

This commit is contained in:
2026-07-31 07:21:52 +01:00
parent 9da1e16318
commit 596b9de047
7 changed files with 17 additions and 5 deletions
+4 -2
View File
@@ -34,9 +34,11 @@ export default async function serverPostBuildFn(params) {
continue;
}
const mock_req = target_artifact.req_url
? new Request(target_artifact.req_url)
? new Request(target_artifact.req_url, {})
: new Request(controller.page_url);
// Always re-run server fns so fixed errors clear on the first HMR
if (controller.page_cookie) {
mock_req.headers.set("cookie", controller.page_cookie);
}
const page_component = await grabPageComponent({
req: mock_req,
return_server_res_only: true,