-
Notifications
You must be signed in to change notification settings - Fork 12k
Html changes not detected in watched library by "ng serve --aot" #13588
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
Sometimes this it doesn't pickup template changes even without aot. I have to save the file two or more times to let the serve process pickup the changes. |
I'm experiencing the same issue as @V3nsla. Is there any way to avoid this AOT behavior? |
The same issue happens with |
I have the exact same issue as well. |
I already report this in Stack overflow and then found this issue. I notice that scss changes are also not affecting. Only ts changes are affecting to main application. And only ng serve restart will work. I will try AOT as well. Here is my stack overflow issue https://stackoverflow.com/questions/54816109/angular-7-library-html-template-changes-are-not-affected-into-application-when-c |
OK. I tested it without --aot and it wasn't working any better. Only ts files are updated properly.
|
Our workaround is to use the library source path in This works with and without aot. |
Same problem here(happens for simple - ng build --watch command too) and its costing us a lot of time. Hope angular-cli fixes this soon. ViceIce, I didn't quite get above, could you show me your previous and new tsconfig.json file? (so that I can get an idea on what options have changed) |
@Nagarjuna-B you simply have to edit the paths in root {
"compilerOptions": {
"paths": {
"@my/package": ["dist/my/package"]
}
}
} from: I've additionally added an
|
Thanks @viceice, it seems the problem for you is with editing html files in an external library and it got fixed by referencing the files from source directory itself. |
@Nagarjuna-B That is strange, we don't have such a problem. Local templates are working fine with and without aot. |
I have found that changes are not detected when the compiler fails the first time you run ng serve if you are using AOT. But if the first time the compilation is successful, then it refreshes well. I have created a repository with minimal code to shown it, The README contains step by step to reproduce. https://github.com/isthar13/angular-cli-aot-bug If the first time you run ng serve using AOT there is any compilation error, all changes made are not detected and the server not reloaded. When no using AOT, although the first time you run ng serve there is some compilation error, it will reload and detect changes fine. |
Same problem here, any news? Thanks |
Does anyone yet test this with angular 8? |
@JanneHarju I did. Still doesn't work :( |
experiencing exactly the same issue, super frustration. EDIT: for me removing |
would love to see a resolution to this. It really slows our dev cycle :( |
I don't use Ivy and it doesn't work for me (latest Angular + CLI). |
This comment has been minimized.
This comment has been minimized.
Going to re-open this, cause I think the original problem still persists. Ie the issue were when changing HTML in a library the changes are not replicated in the application. Regarding the issues when having Ivy enabled, those should be fixed in 8.2.x or you can try the prerelease version using |
Sold, works like a charm! |
@andreifloroiu yes but it works on source code, not on build code which is how Angular CLI scaffolds it and doesn't work. |
I meant that it is the solution to what I needed: work on library from a test project and auto-build on changes to library source. AF |
Increasing the amount of inotify watchers - SourceListen uses inotify by default on Linux to monitor directories for changes. It's not uncommon to encounter a system limit on the number of files you can monitor. For example, Ubuntu Lucid's (64bit) inotify limit is set to 8192. You can get your current inotify file watch limit by executing:
When this limit is not enough to monitor all files inside a directory, the limit must be increased for Listen to work properly.
You may also need to pay attention to the values of max_queued_events and max_user_instances if Listen keeps on complaining. |
I am not sure if that was the fixing point for me in the end, but |
Same issue here with a Nrwl NX workspace where there is an Angular Web app. I've tried increasing the max_user_watches on Minikube (we're using Kubernetes also during development), but it didn't help either. |
I think I still got this problem with Angular CLI 9.x, here's my environment information:
I start my app with First, I can confirmed updates can be found in my Angular Project, the wired things is only changes in library's TypeScript files can be seen in pages, changes in html and styles files remains silent. Tips for one more thing, I declare my component in library with this way:
|
I tried again with I exam all the bundles that Angular generated for my website, suppose I changed a text string from 'a' to 'b', then I couldn't find any 'a' in output bundles (main.js) but only 'b' inside it (begins with codes like I suspect this is because something still inside the running memory, and didn't get refreshed yet. One thing is that the above things happens when I still have my host project's in running state. |
Hi all, this issue is now obsolete when using Ivy. Please update to the most recent Angular CLI version. If the problem persists after upgrading and using Ivy, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. |
@alan-agius4 can you clarify your answer a bit? I'm using Angular 9 with Ivy and using the most recent CLI version, but I still face this issue from time to time (really hard to be able to consistently reproduce it and give a scenario). I've noticed that I'm still using the
This goes through Nx, but it's also up to date.. Are we supposed to remove the |
@dsebastien, you don't need to remove the This issue is specific to libraries being consuming in an application. So your issue might be something different. |
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. |
🐞 Bug report
Command
Description
Html changes are not detected in library when starting project using ng serve --aot. Library is built using --watch flag and main project is served with --aot. On html change build and serve process are triggered and page refreshes but with no changes in html. Typescript changes are visible after rebuild. Html change is only visible when you restart ng serve --aot process.
Without --aot flag everything is working as intended.
Same problem exists with npm linked external library (not in the same project).
🔬 Minimal Reproduction
I made a small repro of the problem: https://github.com/V3nsla/aot-lib-html-changes
To reproduce the problem build library using --watch flag (ng build lib --watch) and start main project using ng serve --aot.
Make some changes in the template of LibComponent and save to trigger build process. After main project is recompiled html changes are not reflected.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: