We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
As soon as I try to call the mqtt connect function, I get this error in the console:
Uncaught ReferenceError: Buffer is not defined at node_modules/mqtt-packet/constants.js
Has anybody successfully gotten mqttjs to work in nuxt 3?
The text was updated successfully, but these errors were encountered:
As soon as I try to call the mqtt connect function, I get this error in the console: Uncaught ReferenceError: Buffer is not defined at node_modules/mqtt-packet/constants.js Has anybody successfully gotten mqttjs to work in nuxt 3?
Hope the following code is useful to you
import * as mqtt from "mqtt/dist/mqtt.min"; if (process.client) { const client = mqtt.connect("ws://broker.emqx.io:8083/mqtt"); console.log("mqtt client", client); }
in addition, refer to the MQTT.js issue: mqttjs/MQTT.js#1269, you should do like this:
MQTT.js
Sorry, something went wrong.
Thank you Betty, that works perfectly :)
0721Betty
No branches or pull requests
As soon as I try to call the mqtt connect function, I get this error in the console:
Uncaught ReferenceError: Buffer is not defined
at node_modules/mqtt-packet/constants.js
Has anybody successfully gotten mqttjs to work in nuxt 3?
The text was updated successfully, but these errors were encountered: