File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @remix-run/router " : patch
3
+ ---
4
+
5
+ Remove instanceof check from isRouteErrorResponse to avoid bundling issues on the server
Original file line number Diff line number Diff line change @@ -1395,8 +1395,14 @@ export class ErrorResponse {
1395
1395
1396
1396
/**
1397
1397
* Check if the given error is an ErrorResponse generated from a 4xx/5xx
1398
- * Response throw from an action/loader
1398
+ * Response thrown from an action/loader
1399
1399
*/
1400
- export function isRouteErrorResponse ( e : any ) : e is ErrorResponse {
1401
- return e instanceof ErrorResponse ;
1400
+ export function isRouteErrorResponse ( error : any ) : error is ErrorResponse {
1401
+ return (
1402
+ error != null &&
1403
+ typeof error . status === "number" &&
1404
+ typeof error . statusText === "string" &&
1405
+ typeof error . internal === "boolean" &&
1406
+ "data" in error
1407
+ ) ;
1402
1408
}
You can’t perform that action at this time.
0 commit comments