nodejs-pubsub
nodejs-pubsub copied to clipboard
Typescript Bug Requesting Uint8Array on Publishing Message but will result in error and still needs Buffer
-
Is this a client library issue or a product issue? Client Library
-
Did someone already solve this? no
-
Do you have a support contract? No
Environment details
- OS:
- Node.js version:
- npm version:
@google-cloud/pubsubversion: 4.8.0
Steps to reproduce
-
Use typescript version 5.6.3
-
Notice that for the pubSubClient.publishMessage method it asks for a Uint8Array and says that a buffer is not assignable to type Uint8Array or string or blah blah.
-
Convert the buffer to a Uint8Array and process.
-
Notice that an error will be thrown with the error message "TypeError: Data must be in the form of a Buffer."
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!