shamblett/mqtt5_client

NoSuchMethodError: method not found

Opened this issue · 2 comments

In our web build we encountered this error many many times.

Screenshot 2024-09-11 alle 13 04 37

the client variable is dynamic and I think in web the destroy method is not implemented.

Yes you are correct, the destroy method is used only on the Socket class. The mqtt_client package does not call destroy during disconnect in the web build. I'll update this package accordingly.

OK, the real fix for this from the mqtt_client package is a rather involved refactoring of the connection handling classes to use generics rather than rely on dynamic typing. This is too large of a change for me to implement and test at the moment.

However, I understand that this is somewhat of a pain so for now I've patched the package to trap the OnNoSuchMethod exception if it is raised and call client.close().

Package re released at version 4.5.3, please try this out.