Currently working on an angular project using ngx-leaflet.
Upon initiating ng serve
in the terminal, the following error message pops up:
Error: node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/leaflet.module.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.
This issue indicates that the library (@asymmetrik/ngx-leaflet) that declares LeafletModule may not have been processed correctly by ngcc or is not compatible with Angular Ivy. Consider checking for a newer version of the library and updating if available. It might also be helpful to reach out to the developers of the library to confirm its compatibility with Ivy.
1 export declare class LeafletModule {
~~~~~~~~~~~~~
The module is imported in the app.module.ts:
import { LeafletModule } from '@asymmetrik/ngx-leaflet';
And added to the @NgModule in app.module.ts:
@NgModule({
declarations: [
...
],
imports: [
ReactiveFormsModule,
AngularFireModule.initializeApp(config),
AngularFireAnalyticsModule,
AngularFirestoreModule,
AngularFireAuthModule,
AngularFireStorageModule,
AngularFireDatabaseModule,
BrowserModule,
AppRoutingModule,
LeafletModule
],
providers: [
...
],
bootstrap: [AppComponent]
})
Could this be a common issue, or am I possibly making an error with the import?
Version details:
Angular CLI: 11.0.6
Node: 12.18.3
OS: darwin x64
Angular: 10.0.8
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1100.6
@angular-devkit/build-angular 0.1100.6
@angular-devkit/core 11.0.6
@angular-devkit/schematics 11.0.6
@angular/cli 11.0.6
@angular/fire 6.0.2
@schematics/angular 11.0.6
@schematics/update 0.1100.6
rxjs 6.5.5
typescript 3.9.7
from package.json:
"@asymmetrik/ngx-leaflet": "^8.1.0",
"leaflet": "^1.7.1",