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

Move from teeny-request to standard Fetch API

Open iRyusa opened this issue 2 years ago • 4 comments

Is your feature request related to a problem? Please describe. Using this lib with Bun is crashing when uploading a file.

1 | (function (stream, autoAllocateChunkSize) {"use strict";
                       ^
TypeError: undefined is not an object
      at lazyLoadStream (:1:20)
      at getReader (:1:20)
      at readStreamIntoSink (:1:32)
      at readableStreamIntoText (:1:20)
      at /.../node_modules/teeny-request/build/src/index.js:223:8
      at processTicksAndRejections (:55:76)

Describe the solution you'd like Now than fetch is standard in Node/Bun/Deno/... I don't see teeny-request is needed as dep.

Describe alternatives you've considered Overriding teeny-request by rexporting fetch locally, not ideal but at least it behave the same and the error goes away.

Additional context n/a

iRyusa avatar Nov 08 '23 17:11 iRyusa

Thanks for opening an issue @iRyusa. We are currently still supporting Node 14+ which means we are unable to make the move to the NodeJS Fetch API that was added in Node 18. However, it is something we have in mind when we move to the appropriate minimum version.

ddelgrosso1 avatar Nov 08 '23 17:11 ddelgrosso1

A quick update, we are in the planning phases of moving away from teeny-request in favor of utilizing the auth client which by extension uses gaxios under the hood. The folks working on gaxios are definitely interested in moving that library away from node-fetch in the future once the minimum supported version moves to Node 18.

ddelgrosso1 avatar Mar 13 '24 13:03 ddelgrosso1

Really nice to hear 🙌

iRyusa avatar Mar 13 '24 13:03 iRyusa

Adding link for tracking / knowledge purposes https://github.com/googleapis/gaxios/pull/618

ddelgrosso1 avatar Apr 22 '24 13:04 ddelgrosso1

Closing this as it should be fixed in gaxios: https://github.com/googleapis/google-cloud-node-core/issues/165

danielduhh avatar Aug 19 '24 18:08 danielduhh