rsnext/errors/invalid-redirect-gssp.md
Lukáš Huvar a6759c62ad
docs: fix missing comma in invalid redirect gssp (#18580)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-10-31 23:37:06 -04:00

705 B

Invalid Redirect getStaticProps/getServerSideProps

Why This Error Occurred

The redirect value returned from your getStaticProps or getServerSideProps function had invalid values.

Possible Ways to Fix It

Make sure you return the proper values for the redirect value.

export const getStaticProps = ({ params }) => {
  if (params.slug === 'deleted-post') {
    return {
      redirect: {
        permanent: true, // or false
        destination: '/some-location',
      },
    }
  }

  return {
    props: {
      // data
    },
  }
}