I am trying to migrate the angular app from 5 to 6 version. The app is running well but if I do some changes in my code after page reloading, I am facing a weird error:
I think it happens when you make changes to module imports during run time.
Run the application again using ng serve
and it fixed the issue for me.
It may also occur when you try to use components of lazy loaded modules in other modules before the lazy module getting loaded or such similar scenarios.