You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add checking of react versions to make sure it
meets the minimum set in peerDependencies
* Simplify react check
* Update error wording
Co-Authored-By: timneutkens <[email protected]>
* Add err.sh
* Update test-production circleci job name
* Add react error message to next-dev-server
* Update test for new wording
You tried running `next` in a project with an incompatible react version. Next.js uses certain react features that when are unavailable show this error since it can't work without them.
6
+
7
+
#### Possible Ways to Fix It
8
+
9
+
Run `npm i react@latest react-dom@latest` or `yarn add react@latest react-dom@latest` in your project and then try running `next` again.
Copy file name to clipboardExpand all lines: packages/next/bin/next.ts
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,12 @@ import arg from 'next/dist/compiled/arg/index.js'
11
11
}
12
12
})
13
13
14
+
constReact=require('react')
15
+
16
+
if(typeofReact.Suspense==='undefined'){
17
+
thrownewError(`The version of React you are using is lower than the minimum required version needed for Next.js. Please upgrade "react" and "react-dom": "npm install --save react react-dom" https://err.sh/zeit/next.js/invalid-react-version`)
Copy file name to clipboardExpand all lines: packages/next/server/next-dev-server.js
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,12 @@ import ErrorDebug from './error-debug'
7
7
importAmpHtmlValidatorfrom'amphtml-validator'
8
8
import{ampValidation}from'../build/output/index'
9
9
10
+
constReact=require('react')
11
+
12
+
if(typeofReact.Suspense==='undefined'){
13
+
thrownewError(`The version of React you are using is lower than the minimum required version needed for Next.js. Please upgrade "react" and "react-dom": "npm install --save react react-dom" https://err.sh/zeit/next.js/invalid-react-version`)
0 commit comments