Skip to content

Commit 3944fcb

Browse files
committed
fix(remix): Instantiate an empty response with an empty json object
1 parent 8659060 commit 3944fcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/remix/src/ssr/rootAuthLoader.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const rootAuthLoader: RootAuthLoader = async (
4141

4242
if (!handler) {
4343
// if the user did not provide a handler, simply inject requestState into an empty response
44-
return injectRequestStateIntoResponse(new Response(), requestState);
44+
return injectRequestStateIntoResponse(new Response(JSON.stringify({})), requestState);
4545
}
4646

4747
const handlerResult = await handler(injectAuthIntoRequest(args, sanitizeAuthObject(requestState.toAuth())));
@@ -62,5 +62,5 @@ export const rootAuthLoader: RootAuthLoader = async (
6262
}
6363

6464
// if the user returned a plain object, simply inject requestState into an empty response
65-
return injectRequestStateIntoResponse(new Response(), requestState);
65+
return injectRequestStateIntoResponse(new Response(JSON.stringify({})), requestState);
6666
};

0 commit comments

Comments
 (0)