Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which package are you using?
@sentry/nextjs
SDK Version
7.7.0
Framework Version
12.2.2
Link to Sentry event
No response
Steps to Reproduce
- Run the wizard command
npx @sentry/wizard -i nextjs
- Rename the generated
_error.js
custom page to_error.tsx
- Provide the
ErrorProps
type fromnext/error
to theCustomErrorComponent
import NextErrorComponent from 'next/error';
import type { NextPage } from 'next';
import type { ErrorProps } from 'next/error';
import * as Sentry from '@sentry/nextjs';
const CustomErrorComponent: NextPage<ErrorProps> = ({ statusCode }) => {
return <NextErrorComponent statusCode={statusCode} />;
};
CustomErrorComponent.getInitialProps = async (context) => {
await Sentry.captureUnderscoreErrorException(context);
// -------------------------------------------^^^^^
return NextErrorComponent.getInitialProps(context);
};
export default CustomErrorComponent;
Expected Result
No typing issue with TypeScript.
Actual Result
Argument of type 'NextPageContext' is not assignable to parameter of type 'ContextOrProps'.
Index signature for type 'string' is missing in type 'NextPageContext'.