I have an app that was originally developed with Angular 6 and has been running fine in production for over two years. This week I started incrementally updating it to the most recent stable version using the Angular Update Guides.
Moving from 6 to 7 went flawlessly but trying to go from 7 to 8 has been a pain. Following the guide went well; the only thing that I had to do not included in the guide is move away from ng4-loading-spinner
to ngx-loading-spinner
. The app compiles and loads eager modules without issue but all lazy loaded modules (the ones I can navigate to without logging in) throw a "BrowserModule has already been loaded" exception.
I've found all the related questions and answers here about only importing the BrowserModule
once and even removed a few imports from my app module that may have been importing BrowserModule
as well (including the ngx-loading-spinner
).
Questions:
- Is there a known issue with updating from 7 to 8 whose resolution is eluding me?
- If not, how can I track down the culprit?
Stack trace:
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:4394)
at _createClass (core.js:30461)
at _createProviderInstance (core.js:30426)
at initNgModule (core.js:30332)
at new NgModuleRef_ (core.js:31561)
at createNgModuleRef (core.js:31544)
at Object.debugCreateNgModuleRef [as createNgModuleRef] (core.js:44911)
at NgModuleFactory_.create (core.js:46088)
at MapSubscriber.project (router.js:6383)
at MapSubscriber._next (map.js:29)
at resolvePromise (zone-evergreen.js:797)
at resolvePromise (zone-evergreen.js:754)
at zone-evergreen.js:858
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
at Object.onInvokeTask (core.js:39680)
at ZoneDelegate.invokeTask (zone-evergreen.js:390)
at Zone.runTask (zone-evergreen.js:168)
at drainMicroTaskQueue (zone-evergreen.js:559)