Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

React Buffer error #1542

Closed
ipewzner opened this issue Oct 3, 2022 · 3 comments
Closed

React Buffer error #1542

ipewzner opened this issue Oct 3, 2022 · 3 comments

Comments

@ipewzner
Copy link

ipewzner commented Oct 3, 2022

  1. If in React you get an error about the Buffer
    try to change the " import mqtt from 'mqtt' " to " import mqtt from 'mqtt/dist/mqtt' "
    credit to: Unable to resolve module url from `node_modules/mqtt/lib/connect/index.js #1020 (comment)

  2. In the example for React is missing some ')}' 4 lines from the bottom.

@MidnightRising
Copy link

Downgrade your react-scripts entry in package.json to 4.0.3. Make the update, delete package-lock.json and then run npm run install

@Jiec-er
Copy link

Jiec-er commented Feb 25, 2023

  1. If in React you get an error about the Buffer
    try to change the " import mqtt from 'mqtt' " to " import mqtt from 'mqtt/dist/mqtt' "
    credit to: Unable to resolve module url from `node_modules/mqtt/lib/connect/index.js #1020 (comment)
  2. In the example for React is missing some ')}' 4 lines from the bottom.

thank you for your help ! before your answer , i get a white page when i run my react application, no any error information😥

@robertsLando
Copy link
Member

I have fixed Browser docs by adding webpack and vite setup. Check them out

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

No branches or pull requests

4 participants