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

ng serve compiling again and again without any saving changes #13099

Closed
HazizKhan opened this issue Nov 30, 2018 · 19 comments
Closed

ng serve compiling again and again without any saving changes #13099

HazizKhan opened this issue Nov 30, 2018 · 19 comments
Labels
needs: more info Reporter must clarify the issue

Comments

@HazizKhan
Copy link

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [x ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Windows 10
@angular/cli: 7.1.0
node: 8.9.4
npm: 5.6.0

Repro steps

run ng serve --disable-host-check
after some time it will start compiling again and again without any changes

Desired functionality

Only compile once after change made by me.

Mention any other details that might be useful

image

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 3, 2018

Thanks for reporting this issue. However we'd need some more information to look into this.

Can you install nodemon via npm i nodemon and in terminal run node_modules/.bin/nodemon --verbose

Thanks

@alan-agius4 alan-agius4 added the needs: more info Reporter must clarify the issue label Dec 3, 2018
@HazizKhan
Copy link
Author

@alan-agius4 Thanks for replying
after installing node-watch there is no such file called node-watch in node_modules/.bin
image

@alan-agius4
Copy link
Collaborator

@HazizKhan, I updated my above comment.

@vovikdrg
Copy link
Contributor

vovikdrg commented Dec 4, 2018

Looks the same as my problem #13125

@vovikdrg
Copy link
Contributor

vovikdrg commented Dec 4, 2018

@alan-agius4

I did run ng serve
then npm i nodemon
then in separate cmd node_modules/.bin/nodemon --verbose

As a result it still recompiles in ng serve

Date: 2018-12-04T05:24:24.899Z - Hash: 71fa5c3e81ceeb3615eb - Time: 1241ms
9 unchanged chunks
i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
i 「wdm」: wait until bundle finished: /login/password

Date: 2018-12-04T05:24:31.014Z - Hash: 71fa5c3e81ceeb3615eb - Time: 5817ms
9 unchanged chunks
i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
i 「wdm」: wait until bundle finished: /styles.css
i 「wdm」: wait until bundle finished: /runtime.js
i 「wdm」: wait until bundle finished: /polyfills.js
i 「wdm」: wait until bundle finished: /vendor.js
i 「wdm」: wait until bundle finished: /main.js

Date: 2018-12-04T05:24:34.187Z - Hash: 71fa5c3e81ceeb3615eb - Time: 2885ms
9 unchanged chunks
i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
i 「wdm」: wait until bundle finished: /styles.css.map
i 「wdm」: wait until bundle finished: /runtime.js.map
i 「wdm」: wait until bundle finished: /polyfills.js.map
 95% emitting CopyPlugini 「wdm」: wait until bundle finished: /vendor.js.map
i 「wdm」: wait until bundle finished: /main.js.map
i 「wdm」: wait until bundle finished: /assets/i18n/en.jsonDate: 2018-12-04T05:24:38.789Z - Hash: 71fa5c3e81ceeb3615eb - Time: 3730ms
9 unchanged chunks
i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
i 「wdm」: wait until bundle finished: /assets/images/logos/logo.svg
i 「wdm」: wait until bundle finished: /assets/images/bgs/bg-login-sidebar.jpg

Date: 2018-12-04T05:24:40.186Z - Hash: 71fa5c3e81ceeb3615eb - Time: 1034ms
9 unchanged chunks
i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
 95% emitting CopyPlugini 「wdm」: wait until bundle finished: /assets/images/logos/logo.svg
i 「wdm」: wait until bundle finished: /assets/images/bgs/bg-login-sidebar.jpg
i 「wdm」: wait until bundle finished: /assets/i18n/en.json
i 「wdm」: wait until bundle finished: /vendor.js.map
i 「wdm」: wait until bundle finished: /main.js.map
Date: 2018-12-04T05:24:48.360Z - Hash: 71fa5c3e81ceeb3615eb - Time: 6496ms
9 unchanged chunks
i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
i 「wdm」: wait until bundle finished: /login/username

Date: 2018-12-04T05:24:52.321Z - Hash: 71fa5c3e81ceeb3615eb - Time: 3455ms
9 unchanged chunks
i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
i 「wdm」: wait until bundle finished: /styles.css
i 「wdm」: wait until bundle finished: /runtime.js
i 「wdm」: wait until bundle finished: /polyfills.js
i 「wdm」: wait until bundle finished: /vendor.js
i 「wdm」: wait until bundle finished: /main.js

Date: 2018-12-04T05:25:00.232Z - Hash: 71fa5c3e81ceeb3615eb - Time: 7402ms
9 unchanged chunks
i 「wdm」: Compiled successfully.
i 「wdm」: Compiling...
i 「wdm」: wait until bundle finished: /runtime.js.map
i 「wdm」: wait until bundle finished: /polyfills.js.map
i 「wdm」: wait until bundle finished: /styles.css.map
 95% emitting CopyPlugini 「wdm」: wait until bundle finished: /assets/i18n/en.json
i 「wdm」: wait until bundle finished: /assets/images/logos/logo.svg
i 「wdm」: wait until bundle finished: /assets/images/bgs/bg-login-sidebar.jpgDate: 2018-12-04T05:25:14.468Z - Hash: 71fa5c3e81ceeb3615eb - Time: 13409ms
9 unchanged chunks

while in that window where i did run nodemon I have output. But while ng serve is recompiling nodemon is not printing anything new. I hope it make sense..

[nodemon] files triggering change check: dist\order\order.service.d.ts
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\order\order.reducer.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\order\order.service.js
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] dist\order\order.service.js

[nodemon] files triggering change check: dist\order\order.service.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\common\url-utils.d.ts
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\common\url-utils.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\credentials\forgot-username-credential.actions.d.ts
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\credentials\forgot-username-credential.reducer.d.ts
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\credentials\forgot-username-credential.actions.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\credentials\forgot-username-credential.reducer.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\credentials\forgot-username-credential.reducer.js
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] dist\credentials\forgot-username-credential.reducer.js

[nodemon] files triggering change check: dist\stepup\stepup.action.js
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] dist\stepup\stepup.action.js

[nodemon] files triggering change check: dist\stepup\stepup.action.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\stepup\stepup.reducer.d.ts
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\stepup\stepup.reducer.js
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] dist\stepup\stepup.reducer.js

[nodemon] files triggering change check: dist\stepup\stepup.reducer.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\stepup\stepup.service.d.ts
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\stepup\stepup.service.js
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] dist\stepup\stepup.service.js

[nodemon] files triggering change check: dist\stepup\stepup.service.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\authentication\auth.action.js
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] dist\authentication\auth.action.js

[nodemon] files triggering change check: dist\authentication\auth.action.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\authentication\auth.reducer.d.ts
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\authentication\auth.reducer.js
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] dist\authentication\auth.reducer.js

[nodemon] files triggering change check: dist\authentication\auth.reducer.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\authentication\auth.service.d.ts
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] files triggering change check: dist\authentication\auth.service.js
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] dist\authentication\auth.service.js

[nodemon] files triggering change check: dist\authentication\auth.service.js.map
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/0
[nodemon] starting `node dist/index.js`
[nodemon] forking
[nodemon] child pid: 118356
[nodemon] watching 141 files
[nodemon] clean exit - waiting for changes before restart

@vovikdrg
Copy link
Contributor

vovikdrg commented Dec 4, 2018

@HazizKhan do you have dist folder in your project? We do have server compiled in that folder.

@alan-agius4
Copy link
Collaborator

@vovikdrg are you including the dist folder in the typescript compilation by any chance ie, adding it in the tsconfig.json?

It would be great if you can you setup a minimal repro please?

You can read here why this is needed. A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

This might be related to your directory structure so its really important to get an accurate repro to diagnose this.

@vovikdrg
Copy link
Contributor

vovikdrg commented Dec 4, 2018

@alan-agius4 Give me some time. I need to ask permission.

Also its probably does not make sense to create new. I am thinking to leave same structure but remove all project related stuff. It seems to bug in structure or specifically in way we created it.

@vovikdrg
Copy link
Contributor

vovikdrg commented Dec 4, 2018

@alan-agius4 It won't be before Monday for sure.

@HannesT117
Copy link

Any updates on this? I have a similar problem. For some reason, when removing assets from root path in angular.json, it stopped recompiling. I was not able to reproduce this in a demo app, though. In any other projects, this wasn't a problem at all. Perhaps someone has a clue what's happening, so I'm sharing it anyways.

"projects": {
  "myProject": {
    "root": "",
     "sourceRoot": "src",
     "assets": [
        <!-- removed this -->
        {
          "glob": "README.md",
          "input": "",
          "output": "/assets"
        }
        <!-- until here -->
      ]
   }
}

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Jan 3, 2019

My though would be something related to webpack-contrib/copy-webpack-plugin#296

Can you check which version of copy-webpack-plugin you have installed. (npm ls copy-webpack-plugin)?

it should be version 4.5.4 or later.

@HannesT117
Copy link

Awesome! It was v4.5.3. After updating @angular-devkit/build-angular to the current version, my problem was gone. Thanks a lot!
@vovikdrg, do you think this could help you as well?

@alan-agius4
Copy link
Collaborator

This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

@tony2tones
Copy link

To resolve this issue i did the following:

ng update @angular/cli @angular/core

@yogeshgadge
Copy link

yogeshgadge commented Apr 24, 2019

I am having the same problem @alan-agius4 even with
npm ls copy-webpack-plugin
-- @angular-devkit/build-angular@0.13.8 -- copy-webpack-plugin@4.6.0

nodemon -verbose not showing anything but it is .idea/workspace.xml

Angular CLI: 7.3.8
Node: 11.6.0
OS: win32 x64
Angular: 7.2.13
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.8
@angular-devkit/build-angular     0.13.8
@angular-devkit/build-optimizer   0.13.8
@angular-devkit/build-webpack     0.13.8
@angular-devkit/core              7.3.8
@angular-devkit/schematics        7.3.8
@angular/cdk                      7.3.7
@angular/cli                      7.3.8
@angular/flex-layout              7.0.0-beta.24
@angular/material                 7.3.7
@ngtools/webpack                  7.3.8
@schematics/angular               7.3.8
@schematics/update                0.13.8
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0


@falasvand
Copy link

problem still exists with angular 7.2.15 and angular-cli 7.3.0

@OussamaHan
Copy link

I had this problem as well. I suggest that you re-install copy-webpack-plugin. This is what fixed it for me.
npm install copy-webpack-plugin --save-dev

@falasvand
Copy link

project im working on doesnt use webpack

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: more info Reporter must clarify the issue
Projects
None yet
Development

No branches or pull requests

8 participants