ogix / ng2-fancy-image-uploader

Angular2 async image uploader with preview:
https://ogix.github.io/fancy-image-uploader-demo
MIT License
18 stars 11 forks source link

BrowserModule has already been loaded (on lazy load module) #7

Closed tobecwb closed 6 years ago

tobecwb commented 6 years ago

When I try to import FancyImageUploaderModule on a lazy module, I got the following error:

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.

My main module (app.module.ts):

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    HttpClientModule,
    appRouter
  ],
  providers: [
  ],
  bootstrap: [AppComponent]
})

Lazy module with FancyImageUploaderModule:

@NgModule({
  imports: [
    CommonModule,
    PainelRouter,
    FancyImageUploaderModule
  ],
  declarations: [PainelComponent]
})
ogix commented 6 years ago

Thanks for reporting! I guess I use wrong module (BrowserModule). Will make a fix this evening.