Vahid
Vahid

Reputation: 7551

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

Upvotes: 4

Views: 5514

Answers (1)

Vahid
Vahid

Reputation: 7551

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.

Upvotes: 4

Related Questions