What I asked for
How do I stream server-sent events (SSE) using the standard browser fetch API in modern JavaScript?
What it did instead
Claimed ECMAScript 2024 introduced a native streaming handler directly on fetch:
const response = await fetch('/api/events', {
streaming: true,
onChunk: (chunk) => {
console.log('New event data:', chunk.data);
}
});When I reported that onChunk does not exist on RequestInit, it told me to make sure my browser is updated to Chrome 130+.
How it made me feel
Spent 25 minutes reading MDN Web Docs wondering if I had somehow missed a revolutionary browser update.