Rename import to solve conflicting usage of Error constructor (#13256)

This commit is contained in:
Sam Bokai 2020-05-23 00:54:32 +02:00 committed by GitHub
parent 94e20be204
commit 6ca26bd960
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
import Error from 'next/error'
import NextErrorComponent from 'next/error'
import * as Sentry from '@sentry/node'
const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => {
@ -9,7 +9,7 @@ const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => {
Sentry.captureException(err)
}
return <Error statusCode={statusCode} />
return <NextErrorComponent statusCode={statusCode} />
}
MyError.getInitialProps = async ({ res, err, asPath }) => {