Closed
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/browser
-
@sentry/node
-
raven-js
-
raven-node
(raven for node) - other:@sentry/nextjs
Version:
"@sentry/nextjs": "^6.3.6",
"next": "^10.0.8",
Description
Exceptions that do not jump to an error page, such as the following, can be correctly detected by Sentry.
import React from 'react';
const Sample: React.FC = () => {
return (
<button
onClick={() => {
throw new Error('Sentry Frontend Error! in useEffect');
}}
>
Throw error
</button>
);
};
export default Sample;
However, Sentry will not detect exceptions that redirect to error pages, such as the following, if you only set @sentry/nextjs
.
import React, { useEffect } from 'react';
const Sample: React.FC = () => {
useEffect(() => {
throw new Error('Sentry Frontend Error! in useEffect');
}, []);
return (
<button
onClick={() => {
// throw new Error('Sentry Frontend Error! in useEffect');
}}
>
Throw error
</button>
);
};
export default Sample;
Does the developer need to include code on the _error page to notify Sentry, as in the following sample?
https://github.com/vercel/next.js/blob/canary/examples/with-sentry/pages/_error.js