You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The will#payload property requires a Buffer to be passed. Though I find it does support strings. Since Buffers are only a thing in Node.JS this means any browser code using the will option need to cast their string to Buffer
constclientId="my-client"constclient=awaitmqtt.connectAsync(url,{
username,
password,
clientId,will: {topic: `health/${clientId}`,payload: 'disconnected'asunknownasBuffer,// cast because browsers don't have Bufferqos: 1,retain: true}})
The text was updated successfully, but these errors were encountered:
The
will#payload
property requires aBuffer
to be passed. Though I find it does supportstring
s. SinceBuffer
s are only a thing in Node.JS this means any browser code using the will option need to cast their string to BufferThe text was updated successfully, but these errors were encountered: