Replies: 2 comments
-
Deno has a windows object. I think this error is probably caused by window.location being undefined. import { EventSource } from "https://deno.land/x/eventsource@v0.0.2/mod.ts";
new EventSource("https://foobar.com/"); > deno run --location=http://foo.com --allow-net ./test.ts Possibly related: MierenManz/EventSource#30 EDIT: Rereading the question, are you trying to use this with node? If so, sorry I'm not sure. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@ayame113 no, this is not node, this is Deno and you are right, I had no idea there was a window object. This is good to know |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I wanted to use
EventSource
server side but looking at this code, it for some reason is reliant on thewindow
object which is not the case in node.I have a cli tool and when I create an
EventSource
object, I getIs there anyway I can use the EventSource class on the server?
Beta Was this translation helpful? Give feedback.
All reactions