-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Error while using with React.js #1441
Comments
I think it needs |
Hello again :)
|
Hi I also get errors when I add the library to my project. After creating the React app and some components, I followed the steps on the website.
However, on the last step I got this error message: (I run the command inside the Mqtt folder)
This file Do you have any idea what I am doing wrong? OS: macOS 12.2.1 Cheers |
Same issues here. Any fixes for it? |
I switched to paho-mqtt. Works fine for me out of the box |
@CodeCook83 It's probably a typo with the doc. You should try with But, just to let you know, i still got the error "Buffer is not defined". |
Hey lots of struggle since 5 6 hours trying to build the mqtt to use with react. so why do we need this command to run and build? All other package comes ready to use. Please make some work around. I am not able to use it with webpack 5. Else please tell us how to compile with older webpack or just share the bundled file.
just frustrated with this error "Buffer is not defined" then "process is not defined" |
Hey I have published a build version of mqtt@4.3.7 , so instead of using mqtt we can use precompiled-mqtt for react and other frontend libraries. |
to resolve Can't resolve 'url' issue: but then we still get the buffer error: |
can you give this package a try. It is the exact same version of mqtt@4.3.7 which will solve all the issues we face in building with webpack |
Had the same issue, and using this package worked for me - thanks! |
This is still a problem, even after either installing url and buffer, as well as adding the webpack config as described at https://viglucci.io/how-to-polyfill-buffer-with-webpack-5 as ./webpack.config.js and selecting that in the IDE as the webpack configuration file. Trying to move off Paho as it does not yet support MQTT 5.0 Environment:
react@18.2.0 $ npm list -g $ npm list |
can you give this package a try. It is the exact same version of mqtt@4.3.7 which will solve all the issues we face in building with webpack |
Could be fixed by #1571 |
MQTT 5.0.0 BETA is now available! Try it out and give us feedback: |
I have fixed Browser docs by adding webpack and vite setup. Check them out |
Hello,
I have an issue that the library doesn't work with React, I get strange errors. It seems like it needs another package.
The text was updated successfully, but these errors were encountered: