Skip to content

Ionic serve breaks on .ts .html refresh #2921

Closed

Description

@Untilo

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

Activity

  1. omarhuss commented on Dec 17, 2017

    @omarhuss

    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
    
  2. peterpeterparker commented on Dec 17, 2017

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

  3. anesask commented on Dec 18, 2017

    @anesask

    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)

  4. nigel-dewar commented on Dec 18, 2017

    @nigel-dewar

    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

  5. maronski commented on Dec 18, 2017

    @maronski

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

    ionic serve -w firefox

  6. dertuerke commented on Dec 18, 2017

    @dertuerke

    you can fix it with if u install manuelly ws.

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

  7. Samykills commented on Dec 18, 2017

    @Samykills

    nope didn't work for me..

  8. dertuerke commented on Dec 18, 2017

    @dertuerke

    @Samykills can u show me your package.json plz

  9. Samykills commented on Dec 18, 2017

    @Samykills

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

  10. dertuerke commented on Dec 18, 2017

    @dertuerke

    what give that back?
    npm info ws version

  11. robinwalser commented on Dec 18, 2017

    @robinwalser

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

  12. omarhuss commented on Dec 18, 2017

    @omarhuss

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

  13. dertuerke commented on Dec 18, 2017

    @dertuerke

    Nice :)

  14. omarhuss commented on Dec 18, 2017

    @omarhuss

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

  15. Samykills commented on Dec 18, 2017

    @Samykills

    @dertuerke ws@3.3.2 worked :D

  16. 2 remaining items

  17. levismiller commented on Dec 18, 2017

    @levismiller

    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.

  18. mhartington commented on Dec 18, 2017

    @mhartington
    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.

  19. atomicnation commented on Dec 18, 2017

    @atomicnation

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

  20. levismiller commented on Dec 18, 2017

    @levismiller

    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.

  21. mhartington commented on Dec 18, 2017

    @mhartington
    Contributor

    ionic/app-scripts@3.1.6 is out!

  22. faizan1219 commented on Dec 19, 2017

    @faizan1219

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

  23. Tommertom commented on Jan 11, 2018

    @Tommertom
    Contributor

    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

  24. dertuerke commented on Jan 11, 2018

    @dertuerke

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

  25. Tommertom commented on Jan 12, 2018

    @Tommertom
    Contributor

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

  26. dertuerke commented on Jan 12, 2018

    @dertuerke

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

  27. Tommertom commented on Jan 12, 2018

    @Tommertom
    Contributor

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

  28. JamboBuenna commented on Feb 19, 2018

    @JamboBuenna

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

  29. imhoffd commented on Feb 21, 2018

    @imhoffd
    Contributor

    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.

  30. locked and limited conversation to collaborators on Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions