@@ -624,7 +624,7 @@ export async function renderToHTML(
624624 ( key ) =>
625625 key !== 'revalidate' &&
626626 key !== 'props' &&
627- key !== 'unstable_redirect ' &&
627+ key !== 'redirect ' &&
628628 key !== 'notFound'
629629 )
630630
@@ -649,11 +649,11 @@ export async function renderToHTML(
649649 }
650650
651651 if (
652- 'unstable_redirect ' in data &&
653- data . unstable_redirect &&
654- typeof data . unstable_redirect === 'object'
652+ 'redirect ' in data &&
653+ data . redirect &&
654+ typeof data . redirect === 'object'
655655 ) {
656- checkRedirectValues ( data . unstable_redirect , req )
656+ checkRedirectValues ( data . redirect , req )
657657
658658 if ( isBuildTimeSSG ) {
659659 throw new Error (
@@ -664,10 +664,10 @@ export async function renderToHTML(
664664
665665 if ( isDataReq ) {
666666 ; ( data as any ) . props = {
667- __N_REDIRECT : data . unstable_redirect . destination ,
667+ __N_REDIRECT : data . redirect . destination ,
668668 }
669669 } else {
670- handleRedirect ( res , data . unstable_redirect )
670+ handleRedirect ( res , data . redirect )
671671 return null
672672 }
673673 }
@@ -768,6 +768,11 @@ export async function renderToHTML(
768768 `unstable_notFound has been renamed to notFound, please update the field to continue. Page: ${ pathname } `
769769 )
770770 }
771+ if ( ( data as any ) . unstable_redirect ) {
772+ throw new Error (
773+ `unstable_redirect has been renamed to redirect, please update the field to continue. Page: ${ pathname } `
774+ )
775+ }
771776
772777 if ( invalidKeys . length ) {
773778 throw new Error ( invalidKeysMsg ( 'getServerSideProps' , invalidKeys ) )
@@ -784,18 +789,15 @@ export async function renderToHTML(
784789 return null
785790 }
786791
787- if (
788- 'unstable_redirect' in data &&
789- typeof data . unstable_redirect === 'object'
790- ) {
791- checkRedirectValues ( data . unstable_redirect , req )
792+ if ( 'redirect' in data && typeof data . redirect === 'object' ) {
793+ checkRedirectValues ( data . redirect , req )
792794
793795 if ( isDataReq ) {
794796 ; ( data as any ) . props = {
795- __N_REDIRECT : data . unstable_redirect . destination ,
797+ __N_REDIRECT : data . redirect . destination ,
796798 }
797799 } else {
798- handleRedirect ( res , data . unstable_redirect )
800+ handleRedirect ( res , data . redirect )
799801 return null
800802 }
801803 }
0 commit comments