NejcZdovc / ng2-select2

Select 2 wraper for angular2
MIT License
123 stars 93 forks source link

node_modules/ng2-select2/ng2-select2.component.d.ts:12:14 - error TS2304: Cannot find name 'Select2Options'.So, finally I got a reason for this error. #151

Open ShirinShirinak opened 4 years ago

ShirinShirinak commented 4 years ago

This issue seems to have existed in the past and there was a comment saying that it got fixed in the newer version but I'm facing the same issue! What should I do?

My dependencies: "@types/select2": "^4.0.49", "ng-select2": "^1.2.2", "ng2-select2": "^1.0.0-beta.16", "select2": "^4.0.13"

ng2-select2 seems to be unusable! I just went through the demo and just copied their dependencies but same issue!

So, finally I got a reason for this error. The interface Select2Options is removed/renamed to Options in the latest version 4.0.45 of the @types/select2. That's why I was getting this error. To resolve this issue, I simply downgrade the @types/select2 package to 4.0.44 by running npm install @ types/select2@4.0.44 --save and this worked for me.

But, guess what? @NejcZdovc already released the new version of ng2-select2 which is 1.0.0-beta.12 20 hours ago. and managed to change the dependencies in the package itself. So, you can happily ignore the workaround done by me. Happy coding...!!!

Originally posted by @imsatish36 in https://github.com/NejcZdovc/ng2-select2/issues/124#issuecomment-386542637