Lazy Loading BrowserModule has already been loaded

后端 未结 8 1887
佛祖请我去吃肉
佛祖请我去吃肉 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

    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.

提交回复
热议问题