TO JS undefined after each Preferences.get & Preferences.set

Hey Capacitor devs,

capacitor version: 4.0
@capacitor/preferences version: 4.0.1

Whenever I call preferences.set() or preferences.get() I see TO JS undefined in the Xcode log & Msg: undefined in the Android Studio run log.

My question: is this normal behavior? The preferences library is working as intended. I am not sure if this is a sign of something wrong or if this is nothing to worry about.

Screenshot of Xcode log:
Screen Shot 2022-10-25 at 4.51.18 PM

Screenshot of Android Studio run log:
Screen Shot 2022-10-25 at 4.50.16 PM

Thanks for having a look

Capacitor plugins return promises, but most times they don’t return any value in the promise, so they return undefined.
So for set call is normal to see the undefined.
If you get it on get call then what would mean it has no value stored for that key.

1 Like