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
Having a packet property set to undefined results in a TypeError:
TypeError [ERR_INVALID_ARG_TYPE]: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received undefined
at Function.byteLength (node:buffer:777:11)
at getLengthProperty (/node_modules/mqtt-packet/writeToStream.js:929:30)
at getProperties (/node_modules/mqtt-packet/writeToStream.js:1003:27)
at publish (/node_modules/mqtt-packet/writeToStream.js:350:22)
at Object.generate [as writeToStream] (/node_modules/mqtt-packet/writeToStream.js:35:14)
at MqttClient._writePacket (/node_modules/mqtt/src/lib/client.ts:1961:29)
at <anonymous> (/node_modules/mqtt/src/lib/client.ts:1862:9)
at Store.put (/node_modules/mqtt/src/lib/store.ts:81:4)
at MqttClient._storeAndSend (/node_modules/mqtt/src/lib/client.ts:1857:22)
at MqttClient._sendPacket (/node_modules/mqtt/src/lib/client.ts:2040:10) {
code: 'ERR_INVALID_ARG_TYPE'
}
This is allowed by the IClientPublishOptions interface and can easily happen if optional properties are passed along into the publish() method of the MqttClient.
MQTTjs Version
5.10.3
Broker
mosquitto 2.0.20
Environment
NodeJS
Description
Having a packet property set to
undefined
results in aTypeError
:This is allowed by the
IClientPublishOptions
interface and can easily happen if optional properties are passed along into thepublish()
method of theMqttClient
.Minimal Reproduction
Debug logs
The text was updated successfully, but these errors were encountered: