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

Ionic serve breaks on .ts .html refresh #2921

Closed
Untilo opened this issue Dec 17, 2017 · 30 comments
Closed

Ionic serve breaks on .ts .html refresh #2921

Untilo opened this issue Dec 17, 2017 · 30 comments

Comments

@Untilo
Copy link

Untilo commented Dec 17, 2017

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

@omarhuss
Copy link

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

@peterpeterparker
Copy link
Contributor

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

@anesask
Copy link

anesask commented Dec 18, 2017

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)

@nigel-dewar
Copy link

nigel-dewar commented Dec 18, 2017

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

@maronski
Copy link

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

ionic serve -w firefox

@dertuerke
Copy link

dertuerke commented Dec 18, 2017

you can fix it with if u install manuelly ws.

npm install ws@3.3.2 --save-dev --save-exact

@Samykills
Copy link

nope didn't work for me..

@dertuerke
Copy link

@Samykills can u show me your package.json plz

@Samykills
Copy link

Samykills commented Dec 18, 2017

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"
}

@dertuerke
Copy link

what give that back?
npm info ws version

@robinwalser
Copy link

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

@omarhuss
Copy link

Yeah, I confirm that running npm i -D -E ws@3.3.2 in your project's path solves the issue.

@dertuerke
Copy link

Nice :)

@omarhuss
Copy link

omarhuss commented Dec 18, 2017

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

@Samykills
Copy link

@dertuerke ws@3.3.2 worked :D

@dertuerke
Copy link

dertuerke commented Dec 18, 2017

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

@villarres
Copy link

npm install ws@3.3.2 --save-dev --save-exact
thank, it work

@levismiller
Copy link

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 ws@3.3.2 --save-dev --save-exact

That command fixed the issue for now.

@mhartington
Copy link
Contributor

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.

@atomicnation
Copy link

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

@levismiller
Copy link

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.

@mhartington
Copy link
Contributor

ionic/app-scripts@3.1.6 is out!

@faizan1219
Copy link

faizan1219 commented Dec 19, 2017

updated to ionic/app-scripts@3.1.6 solves the issue. Thanks @mhartington :)

@Tommertom
Copy link
Contributor

Tommertom commented Jan 11, 2018

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 ws@3.3.2 --save-dev --save-exact

@dertuerke
Copy link

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

@Tommertom
Copy link
Contributor

Tommertom commented Jan 12, 2018

@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!

@dertuerke
Copy link

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

@Tommertom
Copy link
Contributor

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

@JamboBuenna
Copy link

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

@imhoffd
Copy link
Contributor

imhoffd commented Feb 21, 2018

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.

@ionic-team ionic-team locked and limited conversation to collaborators Feb 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests