question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

the Paho-client used in this project tries to declare Paho globally: if (typeof Paho === "undefined") { Paho = {}; } webpack doesn’t seem to handle this correctly and I get an error in my bundle.

Paho not defined node_modules/paho-client/src/mqttws31.js line 83

The Paho client used in the aws-iot-device-sdk does not suffer from this issue.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
suprsidrcommented, Apr 5, 2018

I solved this w/ webpack: resolve: { extensions: ['.js'], alias: { Paho: path.resolve('./paho.js'), }, }, plugins: [ new webpack.ProvidePlugin({ Paho: 'Paho', }) ] and paho.js: export {}

0reactions
undefobjcommented, Mar 23, 2018

Paho isnt the same thing as MQTT.js, they’re separate implementations. Paho is the MQTT reference implementation and works in both web JavaScript applications as well as React Native, whereas MQTT.js does not.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Paho » 'Paho' is undefined - Eclipse Community Forums
Hello, I am trying to run Paho JavaScript Client in my HTML code, but I keep getting this error (Paho is undefined).
Read more >
In MQTT client " Uncaught ReferenceError: Messaging is not ...
I am trying simple websocket based MQTT client and having "Uncaught ReferenceError: Messaging is not defined" error on console ...
Read more >
Paho-MQTT: NameError: name 'Client" is not defined
Paho-MQTT: NameError: name 'Client" is not defined. Fri Nov 17, 2017 9:49 am. Hello, I am running a short python test script to...
Read more >
How to Use The Paho MQTT Python Client - Beginners Guide
In this tutorial we look at the Paho MQTT Python Client. Using an example python script and the online Mosquitto ... NameError: name...
Read more >
Paho JavaScript - MQTT Client Library Encyclopedia - HiveMQ
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found