arkon / ng-sidebar

[Inactive] Angular sidebar component.
https://echeung.me/ng-sidebar
MIT License
388 stars 136 forks source link

Error with Ivy enabled in Angular 9.1 project #206

Closed ruchitp closed 4 years ago

ruchitp commented 4 years ago

Hi @arkon ,

I am getting below error with Angular 9.1 (Ivy enabled).

Below Error with forRoot().

ERROR in node_modules/ng-sidebar/lib/sidebar.module.d.ts:3:23 - error NG6005: SidebarModule.forRoot returns a ModuleWithProviders type without a generic type argument. Please add a generic type 

argument to the ModuleWithProviders type. If this occurrence is in library code you don't control, please contact the library authors.

3     static forRoot(): ModuleWithProviders;
                        ~~~~~~~~~~~~~~~~~~~
src/app/layout/layout.module.ts:21:14 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

Below Error Without forRoot() This likely means that the library (ng-sidebar) which declares SidebarModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

arkon commented 4 years ago

I tried addressing the error message directly by adding the generic type argument, but I'm not sure if it'll fix Ivy compatibility or not. I don't really test it with Ivy since I never actually tried to get it to work with the minimal manually demo setup I have (rather than relying on the Angular CLI, which came around way later).

Let me know if v9.4.0 works.

NicFaulise commented 4 years ago

I solved this by rm -rf node_modules and then doing a fresh npm i. When I recompiled and launched the app, the error was gone.