I am trying to implement lazy loading but getting error as following **
ERROR Error: Uncaught (in promise): Error: BrowserModule has already been loaded.
Import BrowserModule,
BrowserAnimationsModule
, HttpModule
or HttpClientModule
only once, preferably in your root module.
If you are using multiple modules, use Browser
module only once in your app module or some custom module and use CommonModule
from @angular/common
in custom modules.
I was getting the same error , I was trying to reuse components, directives, pipes in multiple components/modules. Instead I imported all reusable components in a core module and imported the core module in multiple components/modules.