-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
bugSomething isn't workingSomething isn't workingdocsImprovements or additions to documentationImprovements or additions to documentationtypescriptSomething for TypeScriptSomething for TypeScript
Description
What version of Bun is running?
1.1.13+bd6a60512
What platform is your computer?
Darwin 23.3.0 arm64 arm
What steps can reproduce the bug?
Take the stream example from the documentation:
const stream = new ReadableStream({
start(controller) {
controller.enqueue("hello");
controller.enqueue("world");
controller.close();
},
});
for await (const chunk of stream) {
console.info(chunk);
}The code runs fine, but the stream symbol raises a typescript error in VSCode:
Type 'ReadableStream<any>' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.ts(2504)
Here is my package.json, right out of bun init;
{
"name": "foobar",
"module": "index.ts",
"type": "module",
"devDependencies": {
"@types/bun": "^1.1.4"
},
"peerDependencies": {
"typescript": "^5.0.0"
}
}
What is the expected behavior?
Type ReadableStream should support async iteration.
What do you see instead?
Type 'ReadableStream<any>' must have a '[Symbol.asyncIterator]()' method that returns an async iterator.ts(2504)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocsImprovements or additions to documentationImprovements or additions to documentationtypescriptSomething for TypeScriptSomething for TypeScript