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

Browser: Cannot read property 'messageId' of #148

Closed
martinzak-zaber opened this issue Nov 24, 2020 · 4 comments
Closed

Browser: Cannot read property 'messageId' of #148

martinzak-zaber opened this issue Nov 24, 2020 · 4 comments

Comments

@martinzak-zaber
Copy link

Hello,

I tried to integrate the library as a replacement for the older aws-iot-sdk. Unfortunately, I am unable to publish messages in a browser. There is an internal callback called, but it looks like the arguments are not passed. The callback then fails when trying to access the packet (argument). Please see the screenshot of the corresponding debugging session.

spot1 Callback about the be called. Notice that the object with messageId is actually there but the callback is empty.

spot2
The actual code of the callback that tries to access messageId and fails.

Thank you for investigating.

@davepotts
Copy link

I'm also experiencing this issue. Its related to the QoS value being set to 0. Higher values do not throw the error

@bretambrose
Copy link
Contributor

Argh, I think I know what this is, but won't be able to get to it for a bit. The QoS 0 is key. We allocate a mqtt packet id for QoS 0 messages in our native mqtt implementation but I'm going to guess that mqtt-js does not and that's what the issue is. I'm not sure what the right resolution here is. I don't think we can make the native and browser behaviors match if the browser doesn't allocate an id. We can certainly stop a crash though, so as a first step we could start with that.

@cyuste
Copy link

cyuste commented Feb 5, 2022

Also experiencing this error, however, catching and ignoring it "solves" the issue

@bretambrose
Copy link
Contributor

Fix has been released in v1.13.0. v2 SDK release to follow shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants