Ionic serve breaking randomly - node v10 or Chrome?


#1

Did you notice that ionic serve is breaking while rebuilding more often than before too?

Do someone use node v10 too?

Or did you upgraded to the last Chrome and notice that the server breaks more often?

I often get after x reload randomly the following error which breaks the server, just wanted to know if it’s only me or not

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

Error [ERR_IPC_CHANNEL_CLOSED]: Channel closed
at process.target.send (internal/child_process.js:627:16)
at taskResolve (/Users/me/Documents/projects/myproject/node_modules/@ionic/app-scripts/dist/worker-process.js:33:13)
at /Users/me/Documents/projects/myproject/node_modules/@ionic/app-scripts/dist/worker-process.js:12:13
Emitted ‘error’ event at:
at process.nextTick (internal/child_process.js:631:35)
at process._tickCallback (internal/process/next_tick.js:61:11)

P.S.: I mention Chrome because it already happens a big couple of months ago that after an upgrade of Chrome some works had to be done in app-scripts in order to fix rebuild


#2

Happens to me too once in a while

Some fixes exists pending the cause

I removed node_modules and reinstalled

Then it worked

But there other solutions related to packages

Very annoying

Looking forward to ionic 4 to ditch ionic cli in favor of angular cli


#3

Thx for the feedback, good to know I’m not alone with that error


#4
Use this command for unhandled error...
npm i -D -E ws@3.3.2

#5

Interesting. Could you explain why installing web socket 3.3.2 solve the issue? reference?


#6

I don’t know :slightly_smiling_face:, I got this solution from forum (When I save my project I should run ionic lab everytime! Why). But this command has solved my issue of unhandled error.

for other reference use this github link - https://github.com/ionic-team/ionic-cli/issues/2921


#7

Thx. This solution is 3-4 years old and ws is now in version 5.2.0 so not sure I would like to install such an outdated lib, but thx for pointing that out. If it breaks to often I will have a look deeper