Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4: ionic serve Error: listen EADDRINUSE :::53703 #3368

Closed
fedme opened this issue Jul 12, 2018 · 5 comments
Closed

v4: ionic serve Error: listen EADDRINUSE :::53703 #3368

fedme opened this issue Jul 12, 2018 · 5 comments
Labels
Milestone

Comments

@fedme
Copy link

fedme commented Jul 12, 2018

Description:
When using CLI v4 with a Ionic 3 project, the ionic serve command only works the first time.

After stopping the command with CTRL+C, running ionic serve again results in a error.

Restarting the computer fixes the problem.

Steps to Reproduce:

  1. Run ionic serve using CLI v4rc11 in a Ionic 3 Project
  2. Stop the serve command (CTRL+C)
  3. Run ionic serve again

Output:

> ionic-app-scripts serve --address 0.0.0.0 --port 8101 --livereload-port 35730 --dev-logger-port 53703 --nobrowser
[app-scripts] [12:31:03]  ionic-app-scripts 3.1.10
[app-scripts] [12:31:03]  watch started ...
[app-scripts] [12:31:03]  build dev started ...
[app-scripts] events.js:183
[app-scripts]       throw er; // Unhandled 'error' event
[app-scripts]       ^
[app-scripts]
[app-scripts] Error: listen EADDRINUSE :::53703
[app-scripts]     at Object._errnoException (util.js:992:11)
[app-scripts]     at _exceptionWithHostPort (util.js:1014:20)
[app-scripts]     at Server.setupListenHandle [as _listen2] (net.js:1355:14)
[app-scripts]     at listenInCluster (net.js:1396:12)
[app-scripts]     at Server.listen (net.js:1480:7)
[app-scripts]     at new WebSocketServer (C:\Users\***\node_modules\ws\lib\WebSocketServer.js:77:20)
[app-scripts]     at Object.createNotificationServer (C:\***\node_modules\@ionic\app-scripts\dist\dev-server\notification-server.js:66:15)
[app-scripts]     at C:\Users\***\node_modules\@ionic\app-scripts\dist\serve.js:58:31
[app-scripts]     at <anonymous>
[app-scripts]     at process._tickCallback (internal/process/next_tick.js:188:7)

[ERROR] A utility CLI has unexpectedly closed.

        The Ionic CLI will exit. Please check any output above for error details.

My ionic info:

Ionic:

   ionic (Ionic CLI)  : 4.0.0-rc.11 (C:\Users\***\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.7.1
   @ionic/app-scripts : 3.1.10

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : none

System:

   Android SDK Tools : 26.0.2
   NodeJS            : v8.11.3 (C:\Program Files\nodejs\node.exe)
   npm               : 5.6.0
   OS                : Windows 10
@ionitron-bot ionitron-bot bot added the triage label Jul 12, 2018
@fedme fedme changed the title v4: ionic serve fails after the 1st time. (CLI v4, framework v3) v4: ionic serve fails after the 1st run. (CLI v4, framework v3) Jul 12, 2018
@imhoffd imhoffd changed the title v4: ionic serve fails after the 1st run. (CLI v4, framework v3) v4: ionic serve Error: listen EADDRINUSE :::53703 Jul 12, 2018
@imhoffd imhoffd added the bug label Jul 12, 2018
@ionitron-bot ionitron-bot bot removed the triage label Jul 12, 2018
@imhoffd imhoffd added this to the CLI 4.0.0 milestone Jul 12, 2018
@imhoffd
Copy link
Contributor

imhoffd commented Jul 12, 2018

Thanks @Raimaj I believe I've found the issue. The fix will be in app-scripts.

@imhoffd
Copy link
Contributor

imhoffd commented Jul 12, 2018

@Raimaj Please update app-scripts: npm install @ionic/app-scripts@latest and see if that clears up the issue.

There may be a second issue where the Ionic CLI is not cleaning up after a serve. See #3022. It seems to happen only sometimes on Windows and I guess I haven't been able to track it down yet.

@fedme
Copy link
Author

fedme commented Jul 12, 2018

@dwieeb Seems to work now but the browser fails to lunch, getting this error instead:
image

Also the port seems to be different at every ionic serve run (always incremented by one).

I should say I am on a different computer right now, this new issue could be totally unrelated. Will be back at the same computer on Monday and will test it then.

@SamiHK
Copy link

SamiHK commented Jul 28, 2018

Do I downgrade to 3.20 ?

@imhoffd
Copy link
Contributor

imhoffd commented Jul 28, 2018

No. This is the fix: npm install @ionic/app-scripts@latest

This issue is resolved. Please create new issues if necessary. @Raimaj

@ionic-team ionic-team locked as resolved and limited conversation to collaborators Jul 28, 2018
trsrm added a commit to powwowinc/ionic-app-scripts-tiny that referenced this issue Jan 2, 2019
3.1.9:
* fix(2889): fix build error with --prod
* fix(serve): start listening when watch is ready
* fix(live-server): update android platform path (ionic-team#1407)
* docs(changelog): 3.1.9

3.1.10:
* Update node-sass dependency (ionic-team#1435)
Updating node-sass dependency from 4.7.2 to 4.9.0 to make it works with node 10 on windows (build fail with ionic start)
* chore(package): bump deps (ionic-team#1421)
* chore(deps): no package lock
* chore(changelog): 3.1.10

3.1.11:
* fix(serve): fix EADDRINUSE issue with dev logger server
fixes ionic-team/ionic-cli#3368
fixes ionic-team/ionic-cli#1678
fixes ionic-team/ionic-cli#1830
fixes ionic-team/ionic-cli#1721
fixes ionic-team/ionic-cli#1866
fixes ionic-team/ionic-cli#1808
fixes ionic-team/ionic-cli#3022
* docs(changelog): 3.1.11 changes

3.2.0:
* feat(environments): configuration via process.env.VAR replacement (ionic-team#1471)
* fix(sass): remove PostCSS warning (ionic-team#1364)
This removes following warning:
Remove warning: Without `from` option PostCSS could generate wrong source map or do not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning
`from: the input file name (most runners set it automatically).`
Source: https://github.com/postcss/postcss
Fixes ionic-team#1359 #13763
ionic-team#1359
ionic-team/ionic-framework#13763
* fix(serve): use wss protocol for secure websocket when page is using https (ionic-team#1358)
* docs(changelog): 3.2.0

3.2.1:
* docs(readme): add note about existing declaration
addresses ionic-team/ionic-cli#3541
* chore(deps): update webpack to 3.12.0 (ionic-team#1477)
* chore(deps): bump node-sass to 4.9.3 to fix security warnings (ionic-team#1483)
* chore(deps): bump node-sass to 4.10.0 to fix security warnings (ionic-team#1493)
* docs(changelog): 3.2.1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants