ReferenceError: ReadableStream is not defined
See original GitHub issueDescribe the bug
If chunker.ts
falls through a bunch of analysis cases it refers to the ReadableStream
symbol, which is not imported or defined anywhere (and so is undefined):
A clear and concise description of what the bug is.
Your environment
SDK version number
@aws-sdk/lib-storage@3.13.1
Is the issue in the browser/Node.js/ReactNative?
Node
Steps to reproduce
import tar from 'tar';
const source = tar.c({
gzip: true,
cwd: files.root,
}, files.fileNames);
const upload = new Upload({
client: await this.s3(),
queueSize: 4, // optional concurrency configuration
leavePartsOnError: false, // optional manually handle dropped parts
params: {
Bucket: this.bucketName,
Key: this.remoteDataKey(pv),
Body: source,
},
});
Observed behavior
ReferenceError: ReadableStream is not defined
Expected behavior
Not this exception.
Additional context
To my mind a readable stream produced by the tar
package should just work, but from the source in chunker.ts
I can tell it’s not going to because that stream fails the type analysis.
Unfortunately this looks like it’s going to break with much of Node’s duck-typed ecosystem.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
ReadableStream is not defined (lib-storage chunker error on ...
I'm not sure about @alexforsyth not being able to reproduce the original issue, as the chunker at lib-storage/src/chunker.ts#L22 definitely doesn't handle ...
Read more >ReadableStream is not defined" - Stack Overflow
When calling pageContent.getTextContent() , which should return a promise, the error " ReferenceError: ReadableStream is not defined " is thrown ...
Read more >ReadableStream is not defined"-node.js - appsloveworld
Coding example for the question Unable to parse page text, getting "ReferenceError: ReadableStream is not defined"-node.js.
Read more >ReadableStream - Web APIs - MDN Web Docs
Chrome Edge
ReadableStream Full support. Chrome43. Toggle history Full support. Edge14...
ReadableStream() constructor Full support. Chrome43. Toggle history Full support. Edge79...
cancel Full support. Chrome43. Toggle...
Read more >readable-stream - npm
Node.js Streams, a user-land copy of the stream library from Node.js. Latest version: 4.2.0, last published: 3 months ago.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just ran into this issue when using jszip which uses readable-stream. When
@aws-sdk/lib-storage
tried to check if theBody
was aReadable
, it was a differentreadable-stream
instance ofReadable
rather than the Node.jsReadable
. Setting aREADABLE_STREAM=disable
environment variable (see readable-stream readable.js#L2) resolves this, however it doesn’t seem ideal. I’m not sure where the change should occur though. Should@aws-sdk/lib-storage
check for the readable-stream instance?@alexforsyth, can this issue be reopened?
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.