-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEXT_REDIRECT
error to be reported as an Unhandled Error in Server Action redirect function.
#14436
Comments
One way to prevent reporting is to add Sentry.init({
/* etc... */
beforeSend(event, hint) {
const error = hint.originalException as Error & { digest?: unknown };
if (
error &&
error.digest &&
typeof error.digest === 'string' &&
error.digest.startsWith('NEXT_REDIRECT;')
) {
return null;
}
return event;
},
/* etc... */
}); |
I don't remember seeing it on Next.js 15-rc0 + sentry/nextjs 8.27.0 , so maybe something changed between Next.js rc1,2 ~ 15.0.3 |
This did the trick for me, thank you. |
A PR closing this issue has just been released 🚀This issue was referenced by PR #14440, which was included in the 8.41.0 release. |
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/nextjs
SDK Version
8.40.0
Framework Version
React 19.0.0-rc-66855b96-20241106 & Next.js 15.0.3
Link to Sentry event
https://nekoyasan.sentry.io/issues/6082760807/events/a7a626e05026406bb3d13a68e8270c92/
Reproduction Example/SDK Setup
Reproduction Example: https://github.com/NEKOYASAN/next-sentry-redirect-minimum-repro
Reproduction Steps (From completely empty)
pnpm create next-app
npx @sentry/wizard@latest -i nextjs --saas
Steps to Reproduce
pnpm run build
pnpm run start
Redirect to example page
Button/example
(butNEXT_REDIRECT
Error is reported to Sentry)Expected Result
Maybe NEXT_REDIRECT should not be reported to Sentry.
Actual Result
Server Action reports
NEXT_REDIRECT
as Unhandled Error.but it does not seem to be reported in
page.tsx
, so there seems to be no problem.The text was updated successfully, but these errors were encountered: