mapiacompany / capacitor-codepush

Capacitor plugin for CodePush
http://appcenter.ms
Other
151 stars 65 forks source link

Cannot read property 'onSyncStatusChanged' of undefined #39

Open vinz-mehra opened 3 years ago

vinz-mehra commented 3 years ago

I am trying to implement CodePush functionality on my app. Followed the readme tutorial line by line but I am receiving the following error

Uncaught (in promise): TypeError: Cannot read property 'onSyncStatusChanged' of undefined TypeError: Cannot read property 'onSyncStatusChanged' of undefined

Project Info

Ionic:

Ionic CLI : 6.16.1 (/usr/local/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 5.6.8 @angular-devkit/build-angular : 12.0.2 @angular-devkit/schematics : 12.0.2 @angular/cli : 12.0.2 @ionic/angular-toolkit : 4.0.0

Capacitor:

Capacitor CLI : 3.0.0 @capacitor/android : 3.0.1 @capacitor/core : 3.0.0 @capacitor/ios : not installed

Clovel commented 3 years ago

Have you defined a onSyncStatusChanged function and added it to you syncOptions object (parameter for sync method) ?

I think the issue here is that syncOptions are marked as optional, but perhaps a check is missing.

Try using a complete sync call with all available arguments.

Clovel commented 2 years ago

Did it work for you @vinz-mehra ?

Clovel commented 2 years ago

I think I found the source of the issue. Se PR #51. There is a strong probability that onSyncError failed too before this fix.