Skip to content

"export 'connect' (imported as 'mqtt') was not found in 'mqtt/dist/mqtt.min' #1799

Answered by robertsLando
jianjun-Web asked this question in Q&A
Discussion options

You must be logged in to vote

is v4.3.7,node is v12,I tried the latest version and the error was the same

That's impossible because I'm using the latest version in browser in many projects and it's working.

Just install latest 5.3.6 and use this:

import mqtt from "mqtt"

Also consider using NodeJS 16/18 at least as NodeJS 12 has reached and of life on April 2022.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@robertsLando
Comment options

@jianjun-Web
Comment options

@robertsLando
Comment options

Answer selected by robertsLando
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants