-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK
Description
- Review the documentation: https://docs.sentry.io/
- Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- Provide a link to the affected event from your Sentry account
Package + Version
-
@sentry/nextjs
6.9.0
Description
Using this code in a Next.js API:
import {captureException, flush, withSentry} from '@sentry/nextjs';
const handler = async () => {
try {
throw new Error(
'This is a fake error meant to help testing Sentry error reporting (monitoring).'
);
} catch (e) {
captureException(e);
await flush(5000); // Need to flush on API to send errors properly (issue in @sentry/nextjs)
}
};
export default withSentry(handler);
Calling the API endpoint runs until the Serverless function times out.
Providing a value to flush()
doesn't seem to be effective.
Metadata
Metadata
Assignees
Labels
Package: nextjsIssues related to the Sentry Nextjs SDKIssues related to the Sentry Nextjs SDK