Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@angular/cli ng serve hangs after some time of working

I've been developing with angular since @angular/cli@5 and ng serve always worked without any problem but recently I updated to 7.0.0 and create a project with angular 7.0.0 and I noticed that after some time of working, angular no longer sees the changes in files. Also refreshing the chrome tab (which the project is served in) will result in infinite spinning.

I thought the problem is with the ~7.0.0 version but when I started working with one of my older projects with version ~6.0.0, the problem existed. I reinstalled @angular/[email protected] globally but the problem persists.

When this problem happens, pressing ctrl+c will write ^C in terminal but it doesn't stop the ng serve command. Pressing the keys again will result in this output:

^C^C[1] 3080 terminated npm start

And of course the port will be blocked.

I use ubuntu 16.04.

like image 914
Vahid Avatar asked Oct 23 '25 18:10

Vahid


1 Answers

I didn't understand the reason for this problem but found the solution. I noticed that the problem occurs after updating scss files, so I found out this should be a problem with node-sass as there were some changes related to node-sass in angular v7.0.0. running npm i -D node-sass (v4.10.0) solved the problem. Also I think that this issue is related to this problem.

like image 118
Vahid Avatar answered Oct 25 '25 07:10

Vahid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!