Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Android PluginName.toJSON() is not implemented on Android. iOS Error code UNIMPLEMENTED #4820

Closed
jepiqueau opened this issue Jul 11, 2021 · 3 comments

Comments

@jepiqueau
Copy link
Contributor

Bug Report

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 3.1.1
  @capacitor/core: 3.1.1
  @capacitor/android: 3.1.1
  @capacitor/ios: 3.1.1

Installed Dependencies:

  @capacitor/core: 3.1.1
  @capacitor/cli: 3.1.1
  @capacitor/android: 3.1.1
  @capacitor/ios: 3.1.1

[success] iOS looking great! 👌
[success] Android looking great! 👌

Platform(s)

Android
iOS

Current Behavior

in Android

2021-07-11 09:28:07.945 3394-3394/jeep.test.bug E/Capacitor/Console: File: http://localhost/vendor.js - Line 43755 - Msg: ERROR Error: Uncaught (in promise): Error: "JeepBug.toJSON()" is not implemented on android
    Error: "JeepBug.toJSON()" is not implemented on android
        at http://localhost/vendor.js:87062:31
        at ZoneDelegate.invoke (http://localhost/polyfills.js:436:30)
        at Object.onInvoke (http://localhost/vendor.js:65973:33)
        at ZoneDelegate.invoke (http://localhost/polyfills.js:435:56)
        at Zone.run (http://localhost/polyfills.js:196:47)
        at http://localhost/polyfills.js:1354:38
        at ZoneDelegate.invokeTask (http://localhost/polyfills.js:470:35)
        at Object.onInvokeTask (http://localhost/vendor.js:65960:33)
        at ZoneDelegate.invokeTask (http://localhost/polyfills.js:469:64)
        at Zone.runTask (http://localhost/polyfills.js:241:51)

in iOS

[error] - ERROR {"rejection":{"code":"UNIMPLEMENTED"},"promise":{"__zone_symbol__state":0,"__zone_symbol__value":"..."},"zone":{"_parent":{"_parent":null,"_name":"<root>","_properties":{},"_zoneDelegate":{"_taskCounts":{"microTask":0,"macroTask":0,"eventTask":0},"zone":"...","_parentDelegate":"...","_forkZS":"...","_forkDlgt":"...","_forkCurrZone":"...","_interceptZS":"...","_interceptDlgt":"...","_interceptCurrZone":"...","_invokeZS":"...","_invokeDlgt":"...","_invokeCurrZone":"...","_handleErrorZS":"...","_handleErrorDlgt":"...","_handleErrorCurrZone":"...","_scheduleTaskZS":"...","_scheduleTaskDlgt":"...","_scheduleTaskCurrZone":"...","_invokeTaskZS":"...","_invokeTaskDlgt":"...","_invokeTaskCurrZone":"...","_cancelTaskZS":"...","_cancelTaskDlgt":"...","_cancelTaskCurrZone":"...","_hasTaskZS":"...","_hasTaskDlgt":"...","_hasTaskDlgtOwner":"...","_hasTaskCurrZone":"..."}},"_name":"angular","_properties":{"isAngularZone":true},"_zoneDelegate":{"_taskCounts":{"microTask":0,"macroTask":1,"eventTask":7},"zone":"...","_parentDelegate":"...","_forkZS":"...","_forkDlgt":"...","_forkCurrZone":"...","_interceptZS":"...","_interceptDlgt":"...","_interceptCurrZone":"...","_invokeZS":{"name":"angular","properties":"..."},"_invokeDlgt":"...","_invokeCurrZone":"...","_handleErrorZS":"...","_handleErrorDlgt":"...","_handleErrorCurrZone":"...","_scheduleTaskZS":{"name":""},"_scheduleTaskDlgt":"...","_scheduleTaskCurrZone":"...","_invokeTaskZS":"...","_invokeTaskDlgt":"...","_invokeTaskCurrZone":"...","_cancelTaskZS":"...","_cancelTaskDlgt":"...","_cancelTaskCurrZone":"...","_hasTaskZS":"...","_hasTaskDlgt":"...","_hasTaskDlgtOwner":"...","_hasTaskCurrZone":"..."}},"task":{"type":"microTask","state":"notScheduled","source":"Promise.then","zone":"angular","runCount":0}}

Expected Behavior

No Error Message

Code Reproduction

i developed a capacitor-jeep-bug plugin which is just the standard echo method see https://github.com/jepiqueau/capacitor-jeep-bug
i created a standard Ionic/Angular App see https://github.com/jepiqueau/test-capacitor3-bug

Other Technical Details

npm --version output: 7.6.0

node --version output: v14.15.4

pod --version output (iOS issues only): 1.10.0

Additional Context

Everything is explained in the readme files

@garaboncias
Copy link

toJSON function is called by JSON.stringify, maybe error reporter like Sentry want to serialize angular context, which contains the plugin.
Maybe would wise to implement toJSON to response some empty object or so

@jepiqueau
Copy link
Contributor Author

@garaboncias Thanks, seems @jcesarmobile proposed a fix for this. Hope the PR will be merged for the next release.

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants