Skip to content

Commit

Permalink
Fix TS error
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 authored and MichaelDeBoey committed Aug 24, 2023
1 parent ac178cb commit 05e2dc6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/remix-server-runtime/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ export const createRequestHandler: CreateRequestHandlerFunction = (
build.entry.module.handleError ||
((error, { request }) => {
if (serverMode !== ServerMode.Test && !request.signal.aborted) {
console.error(isRouteErrorResponse(error) ? error.error : error);
console.error(
// @ts-expect-error This is "private" from users but intended for internal use
isRouteErrorResponse(error) && error.error ? error.error : error
);
}
});

Expand Down Expand Up @@ -225,6 +228,7 @@ async function handleDocumentRequestRR(
// Sanitize errors outside of development environments
if (context.errors) {
Object.values(context.errors).forEach((err) => {
// @ts-expect-error This is "private" from users but intended for internal use
if (!isRouteErrorResponse(err) || err.error) {
handleError(err);
}
Expand Down Expand Up @@ -353,6 +357,7 @@ function errorResponseToJson(
): Response {
return routerJson(
serializeError(
// @ts-expect-error This is "private" from users but intended for internal use
errorResponse.error || new Error("Unexpected Server Error"),
serverMode
),
Expand Down

0 comments on commit 05e2dc6

Please sign in to comment.