Repository navigation
Commit fbd4581
committed
fix: load eventsource with import() for the SSE relay
server.js became an ES module in the ESM migration, but the SSE_RELAY
code path still used require('eventsource'). Setting SSE_RELAY, as the
README recommends for local development, made the bot fail to start
with ERR_AMBIGUOUS_MODULE_SYNTAX (require() is not available in ESM).
Load it with a dynamic import() instead, which keeps eventsource an
optional dev-only dependency, and use its named EventSource export since
eventsource v3+ no longer provides a default export.
Fixes: #706
Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>1 parent 2723715 commit fbd4581
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments