Skip to content

Instantly share code, notes, and snippets.

@asakusuma
Last active July 18, 2017 04:41
Show Gist options
  • Save asakusuma/ee0df442c57e183aac7394c25468af99 to your computer and use it in GitHub Desktop.
Save asakusuma/ee0df442c57e183aac7394c25468af99 to your computer and use it in GitHub Desktop.
Repro streaming response issue
// Run this in your console
var stream = new ReadableStream({
start(controller) {
setTimeout(function() {
controller.enqueue('test');
controller.close();
}, 0);
}
});
var res = new Response(stream);
res.text().then(console.log);
// Causes: Uncaught (in promise) TypeError: Failed to fetch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment