Skip to content

Commit 3fe2eae

Browse files
authored
fix(nextjs): Update check for not found navigation error (#14378)
1 parent 415068a commit 3fe2eae

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

dev-packages/e2e-tests/test-applications/nextjs-turbo/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"extends": "../../package.json"
4747
},
4848
"sentryTest": {
49+
"optional": true,
4950
"optionalVariants": [
5051
{
5152
"build-command": "test:build-canary",

packages/nextjs/src/common/nextNavigationErrorUtils.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ import { isError } from '@sentry/core';
55
* https://beta.nextjs.org/docs/api-reference/notfound#notfound
66
*/
77
export function isNotFoundNavigationError(subject: unknown): boolean {
8-
return isError(subject) && (subject as Error & { digest?: unknown }).digest === 'NEXT_NOT_FOUND';
8+
return (
9+
isError(subject) &&
10+
['NEXT_NOT_FOUND', 'NEXT_HTTP_ERROR_FALLBACK;404'].includes(
11+
(subject as Error & { digest?: unknown }).digest as string,
12+
)
13+
);
914
}
1015

1116
/**

0 commit comments

Comments
 (0)