zefoy / ngx-perfect-scrollbar

Angular wrapper library for the Perfect Scrollbar
MIT License
521 stars 116 forks source link

ngx-perfect-scrollbar compilation issues using enableIvy mode flag #254

Open swapnilfarande opened 5 years ago

swapnilfarande commented 5 years ago

Recently we have upgraded our application to Angular 8 along with ngx-perfect-scrollbar. Everything works fine with serve and full build also works as expected.

For experimental purpose, I tried to set enableIvy flag in tsconfig.app.json as:

  "angularCompilerOptions": {
    "enableIvy": true
  },

Using this we observed that ng serve works as expected, but full build fails with type errors as:


ERROR in app/__ng_typecheck__.ts(157,35): error TS2304: Cannot find name 'as'.
app/__ng_typecheck__.ts(157,38): error TS2345: Argument of type '{ config: any; any: any; }' is not assignable to parameter of type 'Partial<Pick<PerfectScrollbarDirective, "disabled" | "config" | "psScrollY" | "psScrollX" | "psScrollUp" | "psScrollDown" | "psScrollLeft" | "psScrollRight" | "psYReachEnd" | "psYReachStart" | "psXReachEnd" | "psXReachStart">>'.
  Object literal may only specify known properties, and 'any' does not exist in type 'Partial<Pick<PerfectScrollbarDirective, "disabled" | "config" | "psScrollY" | "psScrollX" | "psScrollUp" | "psScrollDown" | "psScrollLeft" | "psScrollRight" | "psYReachEnd" | "psYReachStart" | "psXReachEnd" | "psXReachStart">>'.
app/__ng_typecheck__.ts(157,38): error TS2693: 'any' only refers to a type, but is being used as a value here.
app/__ng_typecheck__.ts(194,36): error TS2304: Cannot find name 'as'.
app/__ng_typecheck__.ts(194,39): error TS2345: Argument of type '{ config: any; any: any; }' is not assignable to parameter of type 'Partial<Pick<PerfectScrollbarDirective, "disabled" | "config" | "psScrollY" | "psScrollX" | "psScrollUp" | "psScrollDown" | "psScrollLeft" | "psScrollRight" | "psYReachEnd" | "psYReachStart" | "psXReachEnd" | "psXReachStart">>'.
  Object literal may only specify known properties, and 'any' does not exist in type 'Partial<Pick<PerfectScrollbarDirective, "disabled" | "config" | "psScrollY" | "psScrollX" | "psScrollUp" | "psScrollDown" | "psScrollLeft" | "psScrollRight" | "psYReachEnd" | "psYReachStart" | "psXReachEnd" | "psXReachStart">>'.
app/__ng_typecheck__.ts(194,39): error TS2693: 'any' only refers to a type, but is being used as a value here.
app/__ng_typecheck__.ts(251,36): error TS2304: Cannot find name 'as'.
app/__ng_typecheck__.ts(251,39): error TS2345: Argument of type '{ config: any; any: any; }' is not assignable to parameter of type 'Partial<Pick<PerfectScrollbarDirective, "disabled" | "config" | "psScrollY" | "psScrollX" | "psScrollUp" | "psScrollDown" | "psScrollLeft" | "psScrollRight" | "psYReachEnd" | "psYReachStart" | "psXReachEnd" | "psXReachStart">>'.
  Object literal may only specify known properties, and 'any' does not exist in type 'Partial<Pick<PerfectScrollbarDirective, "disabled" | "config" | "psScrollY" | "psScrollX" | "psScrollUp" | "psScrollDown" | "psScrollLeft" | "psScrollRight" | "psYReachEnd" | "psYReachStart" | "psXReachEnd" | "psXReachStart">>'.
app/__ng_typecheck__.ts(251,39): error TS2693: 'any' only refers to a type, but is being used as a value here.

Versions:

ngx-perfect-scrollbar@8.0.0

Angular version 
Angular CLI: 8.1.2
Node: 10.16.0
OS: linux x64
Angular: 8.1.2
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, upgrade

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.801.2
@angular-devkit/build-angular     0.800.0
@angular-devkit/build-optimizer   0.800.0
@angular-devkit/build-webpack     0.800.0
@angular-devkit/core              8.1.2
@angular-devkit/schematics        8.1.2
@ngtools/webpack                  8.0.0
@schematics/angular               8.1.2
@schematics/update                0.801.2
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0
sconix commented 5 years ago

I do not expect the IVY to work yet and most likely I do not have time to fix the issues before IVY comes out of experimental state.

mtabaj commented 5 years ago

I know it's hard to do, but ivy is getting VERY close, it's stable now, and a lot of us must begin to convert our applications. It's really a very important issue. Thanks for your help.

SerkanSipahi commented 4 years ago

Im also looking for a solution! I get the same issue. Are you using Angular 9.Next or Angular 8 with Ivy enabled?

mtabaj commented 4 years ago

Janne, I know time is a problem, but Ivy is stable and angular 9 is some days from now. Do you think you'll be able to fix it soon ?

mansoorsgit commented 4 years ago

@sconix , any resolution.Ivy is all around now :)