eclipse-paho / eclipse-paho/paho.mqtt.javascript

Creating new client throws "Cannot read property 'Client' of undefined"

Open
#101 4 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
1.2k
Forks
466
PR merge metrics
No merged PRs in 30d

Description

All is good an well until this line:

`var client = new Paho.MQTT.Client(requestUrl, clientId);`

Where I get the error message
```
Uncaught Error: Cannot read property 'Client' of undefined
at App.initClient (eval at (bundle.js:2341), :201:53)
at App.proxiedMethod (eval at (bundle.js:3565), :44:30)
at eval (eval at (bundle.js:2341), :185:22)
at eval (eval at (bundle.js:4603), :123:23)
at Response.eval (eval at (bundle.js:4651), :258:7)
at Request.eval (eval at (bundle.js:4729), :358:18)
at Request.callListeners (eval at (bundle.js:4687), :105:20)
at Request.emit (eval at (bundle.js:4687), :77:10)
at Request.emit (eval at (bundle.js:4729), :671:14)
at Request.transition (eval at (bundle.js:4729), :22:10)
```

When debugging on the line where Client was supposed to be instantiated, devtools show this:

![screen shot 2017-02-14 at 7 47 39 pm](https://cloud.githubusercontent.com/assets/1390068/22956202/984ef84c-f2ee-11e6-8244-626d06ffb76b.png)

So I can't figure out what I'm doing wrong. About 95% of this is AWS example code. Any ideas?

Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.