Ionic-cli: Ionic serve breaks on .ts .html refresh

Created on 17 Dec 2017  Â·  30Comments  Â·  Source: ionic-team/ionic-cli

Hello here’s an issue i have.

Step to reproduce

  • Create a blank app from command line
  • ionic serve (OK)
  • Update & save html or ts script produces

lint finished in 2.63 s
build started …
deeplinks update started …
deeplinks update finished in 6 ms
template update started …
template update finished in 4 ms
build finished in 15 ms

events.js:183
throw er; // Unhandled ‘error’ event
^

Error: read ECONNRESET
at _errnoException (util.js:1024:11)
at TCP.onread (net.js:615:25)

This occurs only in new projects blank / tabs / sidemenu …

My other projects are still up & running properly

My config :

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:

cordova (Cordova CLI) : 7.1.0
local packages:

@ionic/app-scripts : 3.1.5
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:

Android SDK Tools : 25.2.5
ios-deploy : 1.9.2
ios-sim : 6.1.2
Node : v8.9.3
npm : 5.5.1
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:

ANDROID_HOME : /Users/untildigital/android-sdk/
Misc:

backend : pro
Any help would be appreciated

Cheers

Most helpful comment

you can fix it with if u install manuelly ws.

npm install [email protected] --save-dev --save-exact

All 30 comments

SAME HERE:

Description:

After running ionic serve -l successfully, it crashes as soon as I save a file (whether an HTML or a TS or any file that is in my project) OR if I reload/refresh the page that is served.

Steps to Reproduce:

  1. Execute ionic serve -l.
  2. Save a file in the project after its being served or reloading the page.

Output:

_After running ionic serve -l --verbose:_

[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/.../test', local: true, binPath:
        '/usr/local/lib/node_modules/ionic/bin/ionic', libPath:
        '/Users/.../test/node_modules/ionic/dist/index.js' }
[DEBUG] Daemon found (pid: 658)
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
--lab - Ctrl+C to cancel
[21:26:20]  watch started ...
[21:26:20]  build dev started ...
[21:26:20]  clean started ...
[21:26:20]  clean finished in 1 ms
[21:26:20]  copy started ...
[21:26:20]  deeplinks started ...
[21:26:20]  deeplinks finished in 125 ms
[21:26:20]  transpile started ...
[21:26:23]  transpile finished in 3.18 s
[21:26:23]  preprocess started ...
[21:26:23]  preprocess finished in less than 1 ms
[21:26:23]  webpack started ...
[21:26:23]  copy finished in 3.48 s
[21:26:31]  webpack finished in 8.13 s
[21:26:31]  sass started ...
[21:26:35]  sass finished in 3.29 s
[21:26:35]  postprocess started ...
[21:26:35]  postprocess finished in 9 ms
[21:26:35]  lint started ...
[21:26:35]  build dev finished in 14.89 s
[21:26:35]  watch ready in 14.99 s
[21:26:35]  dev server running: http://localhost:8100/

[OK] Development server running!
     Local: http://localhost:8100
     External: ---
     DevApp: test@8100 on laptop.local

_And as soon as I save a file or reload the page:_

[21:26:39]  lint finished in 4.66 s
events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at _errnoException (util.js:1024:11)
    at TCP.onread (net.js:618:25)

My ionic info:

cli packages: (/Users/.../test/node_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.5
    Cordova Platforms  : ios 4.5.2
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-sim : 6.1.2
    Node    : v8.8.1
    npm     : 5.6.0
    OS      : macOS High Sierra
    Xcode   : Xcode 9.0 Build version 9A235

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : legacy

It looks like this issue is linked with the last update of Google Chrome

ionic serve

ok:
open safari
access localhost:8100
click refresh
no problem

not ok:
open chrome
access localhost:8100
click refresh
=> error

the reason is still unclear

Same here... (+1)
Any solution for this issue?
events.js:160 throw er; // Unhandled 'error' event ^ Error: read ECONNRESET at exports._errnoException (util.js:1020:11) at TCP.onread (net.js:568:26)

Same issue here,

Just cannot use Google Chrome. Even if close chrome completely, restart and still no go

Using Internet Explorer Edge (the new one) for Windows 10 Pro

Try to work on other browser for the mean time. I'm currently using firefox.

ionic serve -w firefox

you can fix it with if u install manuelly ws.

npm install [email protected] --save-dev --save-exact

nope didn't work for me..

@Samykills can u show me your package.json plz

Sure here u go,

Note : i installed ws as global , not with --save

{
"name": "ionic_tutorial",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@angular/common": "5.0.3",
"@angular/compiler": "5.0.3",
"@angular/compiler-cli": "5.0.3",
"@angular/core": "5.0.3",
"@angular/forms": "5.0.3",
"@angular/http": "5.0.3",
"@angular/platform-browser": "5.0.3",
"@angular/platform-browser-dynamic": "5.0.3",
"@ionic-native/core": "4.4.0",
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/status-bar": "4.4.0",
"@ionic/storage": "2.1.3",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.5",
"typescript": "2.4.2"
},
"description": "An Ionic project"
}

what give that back?
npm info ws version

Downgrading ws to 3.3.2 from 3.3.3 helped in my case. works again. Cheers

Yeah, I confirm that running npm i -D -E [email protected] in your project's path solves the issue.

Nice :)

@dertuerke just a little note, please edit your ws version to be 3.3.2 instead of 3.2.2 in your answer.

@dertuerke [email protected] worked :D

sorry, write the wrong version number ^^
Thx @OmarSHussein

npm install [email protected] --save-dev --save-exact
thank, it work

Using ionic 3.19.0 and seeing same error.

events.js:136
throw er; // Unhandled 'error' event
^

Error: read ECONNRESET
at _errnoException (util.js:1031:13)
at TCP.onread (net.js:619:25)

@dertuerke thanks!
npm install [email protected] --save-dev --save-exact

That command fixed the issue for now.

Hey there! Can you please install the nightly version of app-scripts to verify that all is fixed.

npm install @ionic/app-scripts@nightly --save-dev

This just pins the version to 3.3.2 for now until we properly update ws.

@mhartington it worked for me at reloading and at saving!

Re-installed 3.19.0 then ran
npm install @ionic/app-scripts@nightly --save-dev

This did indeed fix the error for me. @mhartington thanks.

ionic/[email protected] is out!

updated to ionic/[email protected] solves the issue. Thanks @mhartington :)

Hi,

Still an issue here with me, after the first edit/save.

A simple project started last week. Its on Github.

https://github.com/Tommertom/worldbooker

Error:

`

[15:31:06] lint finished in 8.44 s
[15:31:18] build started ...
[15:31:18] deeplinks update started ...
[15:31:18] deeplinks update finished in 27 ms
[15:31:18] transpile update started ...
[15:31:19] transpile update finished in 111 ms
[15:31:19] webpack update started ...
[15:31:19] webpack update finished in 897 ms
[15:31:22] build finished in 3.56 s

events.js:160
throw er; // Unhandled 'error' event
^

Error: spawn "C:\Gebruikers\Developer\node.exe" ENOENT
`

ionic info:
`
cli packages: (C:\Users\xxx\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 3.1.7
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

System:

Node : v6.11.2
npm  : 5.6.0
OS   : Windows 7

Environment Variables:

ANDROID_HOME : C:\Gebruikers\Developer\Android\Android\sdk

Misc:

backend : pro

`

package.json:
https://github.com/Tommertom/worldbooker/blob/master/package.json

Already ran ionic doctor and of course did npm install [email protected] --save-dev --save-exact

@Tommertom do you remove the node_modules then reinstalled or installed the ws-module directly?

@dertuerke. I removed node_modules and did npm -i. Then found the suggested solution to do the ws-module on version 3.3.2. As the ionic starter did not install the latest versions of everything I ran ionic doctor to upgrade some parts. Now it still breaks, but sometime also does work. After a few restarts (minimum 2) apparently.

Thx for commenting, though!

@Tommertom if u updated ur Ionic Project u dont need any more the "ws-install"

@dertuerke thx. will start from scratch with a starter, update and then see if it still breaks. Without the ws-install

Just had a new developer install ionic and start using looking at our app, and they are seeing this issue.

This particular issue can be fixed with the following commands:

npm uninstall --save ws
npm install --save-dev @ionic/app-scripts@latest

If you are getting a similar or different issue, please create a new issue and fill out the issue template.

Was this page helpful?
0 / 5 - 0 ratings