You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2026. It is now read-only.
Expected: script runs successfully.
Actual: A TypeError occurs:
TypeError: rawResponseStream.toJSON is not a function
at onResponse (/node_modules/@google-cloud/storage/build/src/file.js:413:51)
at Util.handleResp (/node_modules/@google-cloud/common/build/src/util.js:123:9)
at Duplexify.requestStream.on.on.res (/node_modules/@google-cloud/storage/build/src/file.js:392:31)
at Duplexify.emit (events.js:180:13)
at DestroyableTransform.emit (events.js:180:13)
at onResponse (/node_modules/retry-request/index.js:194:19)
at PassThrough.<anonymous> (/node_modules/retry-request/index.js:149:11)
at PassThrough.emit (events.js:180:13)
at /node_modules/teeny-request/build/src/index.js:186:29
at <anonymous>
Had a look in the debugger - and this stream has no such function, it has a headers object though?
This commit fixes the issue. However I wouldn't be comfortable making a PR out of this because I'm casting to a Readable which may not always be the case?
Environment details
@google-cloud/storageversion: >=2.2.0 (works in 2.1.0)Steps to reproduce
Expected: script runs successfully.
Actual: A TypeError occurs:
TypeError: rawResponseStream.toJSON is not a function at onResponse (/node_modules/@google-cloud/storage/build/src/file.js:413:51) at Util.handleResp (/node_modules/@google-cloud/common/build/src/util.js:123:9) at Duplexify.requestStream.on.on.res (/node_modules/@google-cloud/storage/build/src/file.js:392:31) at Duplexify.emit (events.js:180:13) at DestroyableTransform.emit (events.js:180:13) at onResponse (/node_modules/retry-request/index.js:194:19) at PassThrough.<anonymous> (/node_modules/retry-request/index.js:149:11) at PassThrough.emit (events.js:180:13) at /node_modules/teeny-request/build/src/index.js:186:29 at <anonymous>Had a look in the debugger - and this stream has no such function, it has a
headersobject though?This commit fixes the issue. However I wouldn't be comfortable making a PR out of this because I'm casting to a
Readablewhich may not always be the case?