arkon / ng-sidebar

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

Runtime error with Ivy #187

Closed kKen94 closed 4 years ago

kKen94 commented 5 years ago

image

and this is the sidebar-container.component.js

image

I don't know what else to say, just post the screens

FrankAnthony11 commented 5 years ago

I'm experiencing this problem as well. Had to turn off ivy in order to run the application.

kKen94 commented 5 years ago

Sure, but I would like to use Ivy

nicorivat commented 4 years ago

I'm facing the same issue. To fix this just need to add "decoratorsAs": "static fields" in your angularCompilerOptions (tsconfig.json) and rebuild your library ;) (on the ng-sidebar side of course)

arkon commented 4 years ago

PRs are welcome. :)

kKen94 commented 4 years ago

Angular 9 will be available in few days. It would be a shame to have to give up this library if build with Ivy will not fix

kKen94 commented 4 years ago

Still not work with v9.2.0

image

kKen94 commented 4 years ago

I'm doing some tests. If I enable Ivy on Angular 8 this lib doesn't work. But with Angular 9 rc4 it works

codefun01 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.

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.

I am also getting same error. @arkon Any solution for this? This functionality is very important for us. Any quick solution is appreciated. Thanks in advance.

arunwebber commented 4 years ago

This Worked for me https://github.com/angular/components/issues/18637#issuecomment-592959022