Skip to content

Commit 41d58dc

Browse files
committed
Add legacy field error
1 parent bc11ba5 commit 41d58dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/next/next-server/server/render.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,12 @@ export async function renderToHTML(
754754
key !== 'props' && key !== 'redirect' && key !== 'unstable_notFound'
755755
)
756756

757+
if ((data as any).unstable_redirect) {
758+
throw new Error(
759+
`unstable_redirect has been renamed to redirect, please update the field to continue. Page: ${pathname}`
760+
)
761+
}
762+
757763
if (invalidKeys.length) {
758764
throw new Error(invalidKeysMsg('getServerSideProps', invalidKeys))
759765
}

0 commit comments

Comments
 (0)