Skip to content
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

MQTT 5 issue #1675

Closed
jsb04 opened this issue Aug 19, 2023 · 3 comments
Closed

MQTT 5 issue #1675

jsb04 opened this issue Aug 19, 2023 · 3 comments

Comments

@jsb04
Copy link

jsb04 commented Aug 19, 2023

Hi,
I just tried to upgrade to v5 but found I get a runtime error:

process is not defined
ReferenceError: process is not defined
at ./node_modules/mqtt/build/lib/client.js

I thought this might be because I had to use new MQTTClinet rather than .connect but when I could not find any examples of the constructor arguments:
constructor(streamBuilder: StreamBuilder, options: IClientOptions);
is new MQTTClient required ? could you update / provide an example please?
Also, previously I had to patch it as per: # #1412
eg. modify webpack.config.js and package.json in node_modules/mqtt
I am no longer applying those changes; not certain if that has any bearing on the above issue but applying the same changes I previously was only results in more compilation errors.

Thanks
Josh

@jsb04
Copy link
Author

jsb04 commented Aug 20, 2023

I looked a bit further and I do think the issue probably stems from #1412 - its just that the fix there no longer seems to work for 5.0.3 and it is also annoying that I've been patching this library to make it work.

  1. What would the fix for 5.0.3 be?
    1. Is there a better way than manually patching Matt.js client?
      This is basically blocking my current project :(

@dvkam
Copy link

dvkam commented Aug 20, 2023

See here: #1667

@robertsLando
Copy link
Member

Dup of #1667

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

No branches or pull requests

3 participants