architect / aws-lite

A simple, fast, extensible AWS client
258 stars 15 forks source link

0.21.6: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object #138

Closed alexbepple closed 1 month ago

alexbepple commented 1 month ago

Describe the issue

We wanted to try the new aws-lite version for https://github.com/architect/aws-lite/issues/127. However, we can no longer arc deploy. The stacktrace:

⚬ Hydrate Hydrating dependencies in 1 path
✓ Hydrate Hydrated src/http/get-index/
  | npm i --omit=dev: added 20 packages, and audited 21 packages in 607ms
  | npm i --omit=dev: 3 packages are looking for funding
  | npm i --omit=dev: run `npm fund` for details
  | npm i --omit=dev: found 0 vulnerabilities
✓ Hydrate Successfully hydrated dependencies
⚬ Deploy Initializing deployment
  | Stack ... <redacted>Staging
  | Bucket .. <redacted>
deploy failed! The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object
    at new NodeError (node:internal/errors:406:5)
    at write_ (node:_http_outgoing:879:11)
    at ClientRequest.end (node:_http_outgoing:1030:5)
    at <redacted>/node_modules/@aws-lite/client/src/request/request.js:262:14
    at new Promise (<anonymous>)
    at call (<redacted>/node_modules/@aws-lite/client/src/request/request.js:71:10)
    at request (<redacted>/node_modules/@aws-lite/client/src/request/request.js:33:26)
    at makeRequest (<redacted>/node_modules/@aws-lite/client/src/request/index.js:117:16)
    at _request (<redacted>/node_modules/@aws-lite/client/src/request/index.js:12:16)
    at Object.PutObject (<redacted>/node_modules/@aws-lite/client/src/client-factory.js:144:34)

Expected behavior

No error. ;-)

Steps to reproduce

  1. arc deploy with aws-lite @0.21.6

Platform / version

How urgent do you feel this bug is?

P0 (emergency)

Additional context

No response

alexbepple commented 1 month ago

Reverting to 0.21.4 works. So this looks like a clear regression.

ryanblock commented 1 month ago

Thanks, this was def a p0 caused by a regression pushed last night after tracing an unrelated bug. It is now fixed, thank you very much for reporting!

w5mix commented 1 month ago

Great work, @ryanblock! Thanks for fixing this and the related issue so quickly.