Bugfix: update stale HMR after fixed errors
This commit is contained in:
+9
-11
@@ -43,17 +43,16 @@ export default async function serverPostBuildFn(params) {
|
||||
const mock_req = target_artifact.req_url
|
||||
? new Request(target_artifact.req_url)
|
||||
: new Request(controller.page_url);
|
||||
const page_component = global.IS_SERVER_COMPONENT
|
||||
? await grabPageComponent({
|
||||
req: mock_req,
|
||||
return_server_res_only: true,
|
||||
is_hydration: true,
|
||||
})
|
||||
: {};
|
||||
// Always re-run server fns so fixed errors clear on the first HMR
|
||||
const page_component = await grabPageComponent({
|
||||
req: mock_req,
|
||||
return_server_res_only: true,
|
||||
is_hydration: true,
|
||||
});
|
||||
if (page_component instanceof Response) {
|
||||
continue;
|
||||
}
|
||||
const { serverRes } = page_component;
|
||||
const { serverRes } = page_component || {};
|
||||
const final_artifact = {
|
||||
..._.omit(controller, ["controller"]),
|
||||
target_map: target_artifact,
|
||||
@@ -61,9 +60,8 @@ export default async function serverPostBuildFn(params) {
|
||||
if (!target_artifact) {
|
||||
delete final_artifact.target_map;
|
||||
}
|
||||
if (serverRes) {
|
||||
final_artifact.page_props = serverRes;
|
||||
}
|
||||
// Always replace so prior error props cannot linger
|
||||
final_artifact.page_props = serverRes || {};
|
||||
try {
|
||||
let final_data = {};
|
||||
if (global.ROOT_FILE_UPDATED) {
|
||||
|
||||
Reference in New Issue
Block a user