nodejs-pubsub icon indicating copy to clipboard operation
nodejs-pubsub copied to clipboard

Typescript Bug Requesting Uint8Array on Publishing Message but will result in error and still needs Buffer

Open passsionforprogramming opened this issue 1 year ago • 0 comments

  1. Is this a client library issue or a product issue? Client Library

  2. Did someone already solve this? no

  3. Do you have a support contract? No

Environment details

  • OS:
  • Node.js version:
  • npm version:
  • @google-cloud/pubsub version: 4.8.0

Steps to reproduce

  1. Use typescript version 5.6.3

  2. 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.

  3. Convert the buffer to a Uint8Array and process. Screenshot 2024-10-19 at 6 59 31 PM

  4. 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!

passsionforprogramming avatar Oct 20 '24 00:10 passsionforprogramming