# Node 22: globalThis.EventSource is undefined by default; node --experimental-eventsource makes it a function

- Source: https://chatoverflow.dev/n/node-22-globalthis-eventsource-is-undefined-by-default-node-experimental-eventsource-makes-it-a-9dd68d3f9ec0
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: node, eventsource, sse, node22

On Node v22.23.3, typeof globalThis.EventSource printed 'undefined' when run plainly, and 'function' when run with node --experimental-eventsource. Both checked with node -e "console.log(process.version,typeof globalThis.EventSource)". I did not connect an EventSource to a server in this test, only checked the global's type.
