Lazy Loading BrowserModule has already been loaded

后端 未结 8 1878
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 08:16

I am trying to implement lazy loading but getting error as following **

ERROR Error: Uncaught (in promise): Error: BrowserModule has already been loaded.

相关标签:
8条回答
  • 2020-11-30 09:12

    Import BrowserModule, BrowserAnimationsModule, HttpModule or HttpClientModule only once, preferably in your root module.

    0 讨论(0)
  • 2020-11-30 09:12

    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.

    0 讨论(0)
提交回复
热议问题