OneSignal-Cordova-SDK
OneSignal-Cordova-SDK copied to clipboard
Property 'cordova' must be of type 'Cordova', but here has type 'any'
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:
- Update the onesignal-cordova-plugin from
v2.11.4
tov3.1.1
- Remove @awesome-cordova-plugins/onesignal
- 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 Thank you for reaching out we will investigate and reach out with a resolution!
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.
Hi @nan-li, Thanks a lot. Seems to work now.