next.js/test/e2e/error-handler-not-found-req-url/pages/_error.tsx
_error.tsx23 lines338 B
import type { NextPageContext } from 'next'

Error.getInitialProps = (ctx: NextPageContext) => {
  return {
    reqUrl: ctx.req?.url,
    asPath: ctx.asPath,
  }
}

export default function Error({
  reqUrl,
  asPath,
}: {
  reqUrl?: string
  asPath?: string
}) {
  return (
    <p>
      reqUrl: {reqUrl}, asPath: {asPath}
    </p>
  )
}
Quest for Codev2.0.0
/
SIGN IN