mpetazzoni/sse.js

doesn't work with IE 11

Closed this issue · 3 comments

ap-81 commented

I am using angular 9. I get a JS error (attached) on IE. My browserslist supports IE 9-11 and the target is set to es5 on tsconfig.json. I've included all the polyfills for IE on polyfill.ts.

Does this library work on IE 11 ?

image

image
image
image

(note, I'm not mpetazzoni)

Can you figure out what code it fails on? I believe that if you have the debugger open you can have it show the line.

ap-81 commented

I got this example from an article. stream() method throws the error.

image

.stream() isn't part of the original EventSource API. It's only in sse.js to make it easier to setup event listeners before starting the stream and avoid race conditions. But it's not required to use – in fact, it's only required if you explicitly set the start: false option in the SSE constructor.