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
Amazing package!
Just wanted to check if there could be a way to also support this in non-browser node.js environments.
I was able to get this working in node for my use case but it involved quite a bit of hacks.
If you want Node support without switching libraries: I published a fork, @fitzyracing/fetch-event-source@2.0.2. It is 2.0.1 plus a few-line fix (no document/window needed, uses Node 18+'s built-in fetch), same API and browser behaviour unchanged. Tested in Node 20 and Bun against a local SSE server, including retries with last-event-id and abort.
To fix it inside a dependency without changing code:
Activity
gfortaine commentedon Jan 2, 2023
#28
BuddhaBing commentedon Jan 9, 2023
+1
LZQCN commentedon May 16, 2023
forked
node-fetch-event-source
dargmuesli commentedon Feb 21, 2024
You might want to check out extended-eventsource as potential new replacement. It's codebase looks proper.
fitzyracing1 commentedon Oct 9, 2026
If you want Node support without switching libraries: I published a fork, @fitzyracing/fetch-event-source@2.0.2. It is 2.0.1 plus a few-line fix (no
document/windowneeded, uses Node 18+'s built-infetch), same API and browser behaviour unchanged. Tested in Node 20 and Bun against a local SSE server, including retries withlast-event-idand abort.To fix it inside a dependency without changing code:
Source and tests: https://github.com/fitzyracing1/fetch-event-source. Happy to drop it if upstream ships a release.