How to solve the ISlimScrollOptions import error in angular?

Viewed 984

I run my app using 'ng serve' command and I am getting this error.

ERROR in node_modules/ng2-datepicker/node_modules/ngx-slimscroll/dist/app/ngx-slimscroll/classes/slimscroll-options.class.d.ts:1:10 - error TS2440: Import declaration conflicts with local declaration of 'ISlimScrollOptions'.

1 import { ISlimScrollOptions } from './slimscroll-options.class';

I am new to beginner to angular, I am not getting the proper solution anywhere. Please, Help me with this.

2 Answers

Add the following property to your tsconfig.json to hide the error:

"compilerOptions": {
  "skipLibCheck": true
}

This looks to be to do with a typescript update. https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#local-and-imported-type-declarations-now-conflict

In my case I updated from Angular 6 to 13. I was referencing an older version of ng2-datepicker with a dependency on an old version ngx-slimscroll.

You should update whatever package is depending on ngx slimscroll to get a newer version compatible with typescript 3.7+.

ng2-datepicker updating its slimscroll from 5 => 12 has resolved this for me.

Related