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
6795f681
Unverified
Commit
6795f681
authored
Dec 16, 2018
by
Tim Neutkens
Committed by
GitHub
Dec 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure WebSocket server port is always detected (#5894)
parent
f4a2cbb4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
hot-reloader.js
packages/next/server/hot-reloader.js
+11
-4
No files found.
packages/next/server/hot-reloader.js
View file @
6795f681
...
...
@@ -172,11 +172,18 @@ export default class HotReloader {
async
start
()
{
await
this
.
clean
()
await
new
Promise
(
resolve
=>
{
this
.
wsPort
=
await
new
Promise
((
resolve
,
reject
)
=>
{
// create dynamic entries WebSocket
this
.
wss
=
new
WebSocket
.
Server
({
port
:
0
},
()
=>
{
this
.
wsPort
=
this
.
wss
.
address
().
port
resolve
()
this
.
wss
=
new
WebSocket
.
Server
({
port
:
0
},
function
(
err
)
{
if
(
err
)
{
return
reject
(
err
)
}
const
{
port
}
=
this
.
address
()
if
(
!
port
)
{
return
reject
(
new
Error
(
'No websocket port could be detected'
))
}
resolve
(
port
)
})
})
...
...
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