2023-07-05 15:11:16 +02:00
|
|
|
---
|
|
|
|
title: 'Mixed `notFound` and `redirect`'
|
|
|
|
---
|
2020-11-11 23:02:11 +01:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Why This Error Occurred
|
2020-11-11 23:02:11 +01:00
|
|
|
|
|
|
|
In one of your page's `getStaticProps` or `getServerSideProps` `notFound` and `redirect` values were both returned.
|
|
|
|
|
|
|
|
These values can not both be returned at the same time and one or the other needs to be returned at a time.
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Possible Ways to Fix It
|
2020-11-11 23:02:11 +01:00
|
|
|
|
|
|
|
Make sure only `notFound` **or** `redirect` is being returned on your page's `getStaticProps` or `getServerSideProps`
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Useful Links
|
2020-11-11 23:02:11 +01:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
- [`getStaticProps` Documentation](/docs/pages/building-your-application/data-fetching/get-static-props)
|
|
|
|
- [`getServerSideProps` Documentation](/docs/pages/building-your-application/data-fetching/get-server-side-props)
|