Skip to content

Commit

Permalink
Ensure config's experimental field exists
Browse files Browse the repository at this point in the history
A recent change sets `experimental.reactRoot` on the user's config without checking if the `experimental` key already exists.
  • Loading branch information
bennettdams authored Feb 17, 2022
1 parent 787186a commit 3dbf718
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/next/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,8 @@ export default async function loadConfig(

const hasReactRoot = shouldUseReactRoot()
if (hasReactRoot) {
// users might not have the `experimental` key in their config
userConfig.experimental = userConfig.experimental || {}
userConfig.experimental.reactRoot = true
}

Expand Down

0 comments on commit 3dbf718

Please sign in to comment.