-
Notifications
You must be signed in to change notification settings - Fork 100
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
mqtt.MqttClient is not a constructor #524
Comments
This is also happening to me in NextJS or a standard static site. |
Same issue here using the older mqtt.MqttClient() instead of mqtt5.Mqtt5Client() with the latest SDK. I feel like it's unrelated to your authorization, because I had my custom authorization through lambda working fine, but was still seeing both issues. |
Likewise. Static site with react and vite. Only change across the whole stack is upgrading from 1.20.1 to 1.21.0 |
I'm facing the same issue with mqttClient. (not using mqtt5) I was on version Code
ERRORmqtt.MqttClient is not a constructor Other infoNode version 14.18.0 |
I am also having this issue with SolidStart / SolidJS |
I'm having the same problem using react and vite |
This is clearly due to the 5.x upgrade to the mqtt-js dependency. We will look into it tomorrow first thing. |
I'm having the same problem. Waiting @bretambrose to fix it tomorrow. |
if you need a reproduction this vite project has the issue: https://github.com/sst/ion/blob/dev/examples/aws-realtime/web/src/main.ts |
There seems to be some baffling issues with mqtt-js 5.x and webpack. We are likely going to downgrade the CRT dependency and then rollback the upgrade within the CRT. |
That would be great so that we have atleast something that workable in the meantime. |
The previous release is workable. |
It seems, the issue is in the published MQTT-js package. mqttjs/MQTT.js#1934 and embroider-build/ember-auto-import#608 (comment) provide more details. For now, we reverted the MQTT-js version update in the new release: https://github.com/aws/aws-iot-device-sdk-js-v2/releases/tag/v1.21.1 |
Describe the bug
I am trying to setup a connection to AWS IoT from a web application using Mqtt5 and custom auth. Whenever I call
client.start()
I receive the errormqtt.MqttClient
is not a constructor.Expected Behavior
I would expect that if I had the custom auth configured correctly it would successfully make the connection to mqtt when I call the method
client.start()
.Current Behavior
I get the following error.
Reproduction Steps
This was mainly happening in a React app that is built using Vite. I thought it might be a configuration issue so I cloned this repo and tried the
pub_sub_mqtt5
browser sample. Since I don't use the Cognito I switched the config setup to be the custom auth. Below what thecreateClient
was changed to:I'd also added that in my vite project I tried the proposed solution in issue #474 but that also hasn't worked.
Possible Solution
My best guess as for a solution would be a configuration that needs to be changed. Im sort of at a loss here.
Additional Information/Context
No response
SDK version used
1.21.0
Environment details (OS name and version, etc.)
Sonoma 14.1 on m3 pro
The text was updated successfully, but these errors were encountered: