rsnext/errors/invalid-redirect-gssp.md
Maedah Batool 60488e68e3
Fix broken data fetching links in docs (#33766)
* Fix broken links for Data Fetching

* Fix link data fetching doc

* Improve link file paths

* Update errors/large-page-data.md

Co-authored-by: Steven <steven@ceriously.com>

* Update links

* Fix linting

* Lint tests

* Lint tests

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2022-04-22 14:03:07 +02:00

689 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
    },
  }
}