AnsweredAssumed Answered

Unable to import CoreModule inside lazy loaded modules.

Question asked by yadavami on Jan 4, 2018
Latest reply on Jan 9, 2018 by dvuika

I have a common module where all the dependencies related to Alfresco are imported(containing CoreModule), now when I try to inject this common module inside my lazyloaded module it does not work.

Console Error :

ERROR Error: Uncaught (in promise): Error: BrowserModule has already been loaded. If you need access to common Rdirectives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.
Error: BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.
at new BrowserModule (platform-browser.js:4579)
at _createClass (core.js:10915)
at _createProviderInstance$1 (core.js:10889)
at initNgModule (core.js:10842)
at new NgModuleRef_ (core.js:12096)
at createNgModuleRef (core.js:12086)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (core.js:14430)
at NgModuleFactory_.create (core.js:15575)
at MapSubscriber.eval [as project] (router.js:4507)
at MapSubscriber._next (map.js:79)
at new BrowserModule (platform-browser.js:4579)
at _createClass (core.js:10915)
at _createProviderInstance$1 (core.js:10889)
at initNgModule (core.js:10842)
at new NgModuleRef_ (core.js:12096)
at createNgModuleRef (core.js:12086)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (core.js:14430)
at NgModuleFactory_.create (core.js:15575)
at MapSubscriber.eval [as project] (router.js:4507)
at MapSubscriber._next (map.js:79)
at resolvePromise (zone.js:783)
at resolvePromise (zone.js:754)
at eval (zone.js:831)
at ZoneDelegate.invokeTask (zone.js:424)
at Object.onInvokeTask (core.js:4744)
at ZoneDelegate.invokeTask (zone.js:423)
at Zone.runTask (zone.js:191)
at drainMicroTaskQueue (zone.js:595)

Outcomes