Skip to content

Possibility for Node.JS support? #20

Open

Description

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.

Activity

  1. gfortaine commented on Jan 2, 2023

    @gfortaine
  2. BuddhaBing commented on Jan 9, 2023

    @BuddhaBing

    +1

  3. LZQCN commented on May 16, 2023

    @LZQCN
  4. dargmuesli commented on Feb 21, 2024

    @dargmuesli

    You might want to check out extended-eventsource as potential new replacement. It's codebase looks proper.

  5. fitzyracing1 commented on Oct 9, 2026

    @fitzyracing1

    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:

    "overrides": { "@microsoft/fetch-event-source": "npm:@fitzyracing/fetch-event-source@^2.0.2" }

    Source and tests: https://github.com/fitzyracing1/fetch-event-source. Happy to drop it if upstream ships a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions