Unverified Commit 7696124a authored by Jan Kaifer's avatar Jan Kaifer Committed by GitHub

Remove duplicated if statement (#47322)

Came across these two if statements that had equal conditions.

The second error could never get thrown.
parent 8a4e8059
...@@ -1139,19 +1139,11 @@ export async function renderToHTML( ...@@ -1139,19 +1139,11 @@ export async function renderToHTML(
if (process.env.NEXT_RUNTIME === 'edge' && Document.getInitialProps) { if (process.env.NEXT_RUNTIME === 'edge' && Document.getInitialProps) {
// In the Edge runtime, `Document.getInitialProps` isn't supported. // In the Edge runtime, `Document.getInitialProps` isn't supported.
// We throw an error here if it's customized. // We throw an error here if it's customized.
if (!BuiltinFunctionalDocument) {
throw new Error(
'`getInitialProps` in Document component is not supported with the Edge Runtime.'
)
}
}
if (process.env.NEXT_RUNTIME === 'edge' && Document.getInitialProps) {
if (BuiltinFunctionalDocument) { if (BuiltinFunctionalDocument) {
Document = BuiltinFunctionalDocument Document = BuiltinFunctionalDocument
} else { } else {
throw new Error( throw new Error(
'`getInitialProps` in Document component is not supported with React Server Components.' '`getInitialProps` in Document component is not supported with the Edge Runtime.'
) )
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment