I faced it last week again. My first above comment is still valid, I think it may happen sometimes if you are working and modidying components or components called in components, something like
while having ionic serve running
Modification in a page => Reload ok
Modification in a component used in a page => Reload probably always ok too
Modification in a component used in a componennt used in a page => Mmmmh not sure, not always
I still have this problem to this day. The issue is for sure related to editing modules that are exported for use in other modules. Some deep pathing issues it seems.
I’ve started using ionic since a week ago and this interrupts my flow every time cause I need to go in and re-save several .ts files to fix the issue. My latest issue (although I’ve experienced several throughout the week) was:
I created a new pipe, there was an initial syntax error with it (perhaps causing the error chain). I fixed the syntax error with the pipe, and suddenly I get an error message about a null function in one of my providers. I go in and simply resave that provider file with no modifications and that message disappears. But I get yet another error message about a missing function in yet another provider, I resave that one. And everything works.
Althought it is easy to fix, this bug is continuously breaking my working flow, I forget what I was actually trying to accomplish. Of course making the ionic (learning) experience very problematic.
Please take a good look at how ionic serve is caching files, because I suspect it is somehow using old files when things go south. Of course, it may also be my environment:
I’m on a Mac OS X using Chrome with “No Cache” addon. Using ionic 3.19.1. I’m using ionic serve -c command
I’m on "@ionic/app-scripts": "^3.2.0", and still have this problem.
I’m also 100% sure this has nothing to do with browser caching. I can see old data in the www folder.