edusperoni / nativescript-mqtt

MQTT 3.1.1 for Nativescript
Apache License 2.0
12 stars 3 forks source link

Plugin not working with Nativescript 7 on iOS #14

Closed kryptus36 closed 3 years ago

kryptus36 commented 3 years ago

Which platform(s) does your issue occur on?

iOS, emulator & physical device. Works on Android.

Please, provide the following version numbers that your issue occurs with:

7.0.8

The problem actually occurs in the underlying paho-mqtt.js file. Line 733. It looks like maybe NS doesn't export clearTimeout as a global any more but that's purely a guess. I tried a couple of import/require statements in the file but couldn't get it to work.

It's possible this is a bug in NS itself in the switch to V8. I can file a bug there if that is indeed the case

TypeError: clearTimeout is not a function at Pinger.reset (file:///app/vendor.js:98371:5) at ClientImpl.LibraryFactory.ClientImpl._socket_send (file:///app/vendor.js:99115:20) at ClientImpl.LibraryFactory.ClientImpl._on_socket_open (file:///app/vendor.js:98854:9) at NativeWebSockets.onopen (file:///app/vendor.js:97821:14) at NativeWebSockets.push.NativeWebSockets._notifyBrowser (file:///app/vendor.js:64339:29) at NSObject_2.webSocketDidOpen

edusperoni commented 3 years ago

Hey @kryptus36. It does seem something is not being polyfilled in time. I'll take a look but this is probably something that has to be handled in the core implementation.

I'll try to find a workaround somewhere to make sure these globals are properly polyfilled

kryptus36 commented 3 years ago

@edusperoni thanks, I appreciate it! Let me know if I should file a bug over there.

edusperoni commented 3 years ago

@kryptus36 please take a look at the newest published version 3.0.0. It's a complete refactor and should have this issue fixed.

kryptus36 commented 3 years ago

Thanks for the update!

I'm no longer seeing this issue but I am having another issue. I'll file a separate bug...