-
Notifications
You must be signed in to change notification settings - Fork 12k
Running ng build --watch
not always picking up some code changes
#9572
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
Comments
Have you tried the (--poll)[https://github.com/angular/angular-cli/wiki/build] option? |
This seems like a bug but we'll need to look at a reproduction to find and fix the problem. 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 |
I have been encountering something similar, so I'll tack it on here before creating a complete new issue if necessary. I just recently jumped into an angular project, and found that the app was building fine with the I started digging around the tasks and commands in the @angular/cli folder, and found in the commands/build.js file, there's a check for |
I can try to make a repro. I am not sure what is causing the issue, so it might take a little time. I have not tried using the --poll option. I'll give it a try. Does anyone know the default poll time? |
Just an update. Been having trouble reproducing the issue. I am not sure if it is due to our use of a fair number of lazy loaded modules or not. Once I am able to reproduce the issue I'll share how. |
@filipesilva |
Thanks for the update. Am I understanding correctly, we can just use the demo you have linked as a reproduction of the issue? I have been buried in another project lately, an Ionic project, so I have not been running into this issue recently. It still happens with the other project I have, though, when I fix bugs in it. I had upgraded to CLI 1.7.4, and a few other versions, and I still had plenty of issues with builds...both when doing watch, as well as when running tests. The builds are so inconsistent that they are effectively broken, and autowatching the test build is completely broken. These are very critical tools, and them not working really poses a serious productivity issue. |
I'm sorry, but we can't reproduce the problem following the instructions you provided. If the problem persists, please open a new issue following our submission guidelines. A good way to make a minimal repro is to create a new app via |
My problem is little bit similar with this one. Should I open new issue? https://stackoverflow.com/questions/54816109/angular-7-library-html-template-changes-are-not-affected-into-application-when-c I haven't yet done any repro repo But I maybe will make new project and library and try similar scenario. OK there was already issue that seems similar with my problem #13588 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When running
ng build
with--watch
, which we do pretty regularly as we have either nodemon or pm2 running a node server that hosts our site as well as API, background workers, our whole server backend basically, we often find that many code changes are not properly detected by ng build and it will report unchanged chunks, rather than properly rebuilding those that have actually had changes to the code.We have observed that if a template is then changed in the same chunk, that usually results in the build properly rebuilding that chunk. Sometimes total removal of code from a file, to force an error, then restoration of it, will force proper rebuilding of a chunk.
Versions
Repro steps
Observed behavior
Desired behavior
I would expect ng build to properly account for all changes made, to both code and templates, and the proper rebuilding of affected chunks.
Mention any other details that might be useful (optional)
This behavior is inconsistent, it does not always happen. It seems I encounter it most often with changes to models, properties in components, etc. This often leads to confusion when testing in the UI, and recent changes are not being applied. I have not been able to identify a specific scenario where it always occurs. Sometimes it seems like the code change may not actually matter, and the lack of rebuilding is immaterial...however upon testing again in the browser, the old issues remain, indicating the code change does indeed matter.
The text was updated successfully, but these errors were encountered: