While running a build watch with the '--prod' or '--aot' options, the results to dist seem to be one save behind. Meaning, if I make a change and save, the change is detected and the project builds, however the results are the state of the app before the change. If I make another change, like adding a new line to a file, the change is detected and the project built, with the results of the previous save but not capturing the new lines added.
_Note: This issue goes away if the '--prod' or '--aot' options are not used._
Windows 10
@angular/cli: 1.0.0-beta.30
node: 6.9.5
os: win32 x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-beta.30
@angular/compiler-cli: 2.4.8
ng new test-app
ng build --prod --watch
or
ng build --aot --watch
or
ng build --prod --aot --watch
None
After solving issue #5138 this problem went away. My guess is I somehow had multiple versions of angular-cli installed that were conflicting with each other.
Correction, I'm still experiencing this issue on another computer after following the same steps I used to solve #5138 . I found that if I make a change to the index file, I can see the change take immediate effect in the dist folder. However, a change to a component does not show up, and is always one save behind.
Same here, build -w --aot outputs first compilation result correctly, but then every next rebuild is one save behind (I have to make 2 changes & saves to see result of first change). Doesn't happen without --aot / --prod.
Can confirm this also happens on ng serve --aot. Looking into it.
Possibly related, but I can't see the issue fixed by it: https://github.com/angular/angular-cli/pull/4009
I investigated a bit more and this doesn't seem to happen on all changes.
I can reproduce when changing a component template, but not when changing the component itself (changes are immediately reflected in this case).
So this seems related to the child compilers we use.
FYI - I might have had this same issue. Apparently I had another ng build process running in the background. when I killed that the issue got resolved.
@filipesilva @bklik I am also experiencing this issue...
(My current workflow is to always CTRL+S twice)
I noticed on @bklik's version output that they are running node: 6.9.5. My local version of node is 6.9.5 and wondering if that could have anything to do with this?
Unfortunately, I can only installed "approved" versions of node at work :-1: so I cannot update my node at this time.
OS: Ubuntu 16.04.
Command: "ng build --watch -prod -oh none --aot true".
My save .css .html file is to always CTRL+S twice. (loading build is so long)
I noticed the same / similar problem myself.
npm start -- -o -aotYou can reproduce this problem in the following repo (generated using the cli): https://github.com/christianacca/rxjs-err-async-pipe/commit/c9909e48c6443bc9026d994e9aac2b74e22b16e3
Try changing ticks$ to private
I am seeing the same problem. Change are always one save behind. The behavior is only experienced when using --aot or --prod. Other developers with the same project get the same problem. I see the same problem with the repo that @christianacca linked above.
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._
Most helpful comment
I investigated a bit more and this doesn't seem to happen on all changes.
I can reproduce when changing a component template, but not when changing the component itself (changes are immediately reflected in this case).
So this seems related to the child compilers we use.