OneSignal-Cordova-SDK icon indicating copy to clipboard operation
OneSignal-Cordova-SDK copied to clipboard

Property 'cordova' must be of type 'Cordova', but here has type 'any'

Open djbanana1 opened this issue 2 years ago • 1 comments

Description: We were using "onesignal-cordova-plugin": "2.11.4" & "@awesome-cordova-plugins/onesignal": "5.44.0" in our ionic app and we had to update it to the latest v3.1.1 because of the android api level 31. After updating the onesignal-cordova-plugin to v3.1.1 and serving the app we receive the following error (see end of file for the console output).

It seems that the type cordova from the onesignal-cordova-plugin is overlapping the one from @types/cordova.

Do you know how i can fix this, without just adding "skipLibCheck": true to my tsconfig.json file?

Environment "@ionic/angular": "6.2.2", "@angular/cdk": "14.1.2", "onesignal-cordova-plugin": "3.1.1",

Steps to Reproduce Issue:

  1. Update the onesignal-cordova-plugin from v2.11.4 to v3.1.1
  2. Remove @awesome-cordova-plugins/onesignal
  3. Serving the app using ionic s

Anything else:

[ng] 
[ng] Error: node_modules/onesignal-cordova-plugin/dist/index.d.ts:34:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'cordova' must be of type 'Cordova', but here has type 'any'.
[ng] 
[ng] 34         cordova: any;
[ng]            ~~~~~~~
[ng] 
[ng]   node_modules/@types/cordova/index.d.ts:62:3
[ng]     62   cordova:Cordova;
[ng]          ~~~~~~~
[ng]     'cordova' was also declared here.
[ng] 
[ng] 
[ng] 

djbanana1 avatar Aug 23 '22 06:08 djbanana1

@djbanana1 Thank you for reaching out we will investigate and reach out with a resolution!

emawby avatar Aug 25 '22 17:08 emawby

Hi @djbanana1,

Thanks again for reporting this. We fixed this in the latest release 3.2.0. Please let us know if you run into any issues.

nan-li avatar Sep 23 '22 22:09 nan-li

Hi @nan-li, Thanks a lot. Seems to work now.

djbanana1 avatar Sep 26 '22 07:09 djbanana1