Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 674 Bytes

invalid-redirect-gssp.md

File metadata and controls

32 lines (24 loc) · 674 Bytes

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

Useful Links