Move from teeny-request to standard Fetch API
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
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.
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.
Really nice to hear 🙌
Adding link for tracking / knowledge purposes https://github.com/googleapis/gaxios/pull/618
Closing this as it should be fixed in gaxios: https://github.com/googleapis/google-cloud-node-core/issues/165