Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
0c8dca6f
Commit
0c8dca6f
authored
Oct 09, 2017
by
Arunoda Susiripala
Committed by
Guillermo Rauch
Oct 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Warn and exit if React 15 used inside the project. (#3061)
This usually helps when upgrading Next.js.
parent
8ab50ecb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
index.js
server/index.js
+13
-0
No files found.
server/index.js
View file @
0c8dca6f
...
@@ -16,6 +16,19 @@ import { getAvailableChunks } from './utils'
...
@@ -16,6 +16,19 @@ import { getAvailableChunks } from './utils'
import
getConfig
from
'./config'
import
getConfig
from
'./config'
// We need to go up one more level since we are in the `dist` directory
// We need to go up one more level since we are in the `dist` directory
import
pkg
from
'../../package'
import
pkg
from
'../../package'
import
reactPkg
from
'react/package'
// TODO: Remove this in Next.js 5
if
(
!
(
/^16
\.
/
.
test
(
reactPkg
.
version
)))
{
const
message
=
`
Error: Next.js 4 requires React 16.
Install React 16 with:
npm remove react react-dom
npm install --save react@16 react-dom@16
`
console
.
error
(
message
)
process
.
exit
(
1
)
}
const
internalPrefixes
=
[
const
internalPrefixes
=
[
/^
\/
_next
\/
/
,
/^
\/
_next
\/
/
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment