diff --git a/examples/with-sentry/pages/_error.js b/examples/with-sentry/pages/_error.js index 0b38c8d7b7776..5410de207dd19 100644 --- a/examples/with-sentry/pages/_error.js +++ b/examples/with-sentry/pages/_error.js @@ -1,14 +1,12 @@ import NextErrorComponent from 'next/error' import * as Sentry from '@sentry/node' -const MyError = async ({ statusCode, hasGetInitialPropsRun, err }) => { +const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => { if (!hasGetInitialPropsRun && err) { // getInitialProps is not called in case of // https://github.com/vercel/next.js/issues/8592. As a workaround, we pass // err via _app.js so it can be captured Sentry.captureException(err) - // flush is needed after calling captureException to send server side errors to Sentry, otherwise the serverless function will exit before it's sent - await Sentry.flush(2000) } return