/home/nfantone/dev/js/tfo/tfo-ms-contact/node_modules/mqtt/lib/connect/index.js:112
throw new Error('Missing clientId for unclean clients');
^
Error: Missing clientId for unclean clients
at Object.connect (/home/nfantone/dev/js/tfo/tfo-ms-contact/node_modules/mqtt/lib/connect/index.js:112:11)
Which is, actually, expected as per connect/index.js:112:
if (false === opts.clean && !opts.clientId) {
throw new Error('Missing clientId for unclean clients');
}
Docs state that, if unset, the default value of
options.clientId
should be:And, indeed, I've noticed that if you create a
MqttClient
instance, its constructor proceeds like so:However, if you follow the example in the
README.md
and call.connect()
directly on the module withclean: false
as an optionIt fails before even creating the client with:
Which is, actually, expected as per
connect/index.js:112
:Is this by design/intentional? What's the catch?
Thank you.