# EventSource polyfill for IE11 gremlins

**URL:** https://discourse.roots.io/t/eventsource-polyfill-for-ie11-gremlins/10069
**Category:** sage
**Tags:** webpack
**Created:** 2017-07-26T07:10:40Z
**Posts:** 5

## Post 1 by @ian — 2017-07-26T07:10:40Z

Howdy friends

Trying to run webpack on IE11 (yes it’s completely sadomasochistic). Need to implement a polyfill for a feature IE11 doesn’t support called EventSource. Here’s the error:

`webpack-hot-middleware's client requires EventSource to work. You should include a polyfill if you want to support this browser: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events#Tools`

And here is the most likely polyfill.

> **[GitHub - Yaffle/EventSource: a polyfill for http://www.w3.org/TR/eventsource/](https://github.com/Yaffle/EventSource)**
>
> a polyfill for http://www.w3.org/TR/eventsource/. Contribute to Yaffle/EventSource development by creating an account on GitHub.

But I’m not sure how to implement in the build scripts :frowning: Though here is an example that references the above polyfill at the end of discussion of a slightly different polyfill.

> <https://github.com/webpack-contrib/webpack-hot-middleware/issues/53>
>
> Could you provide a complete example of working on IE?
> 
> I refer the https://gith…ub.com/glenjamin/webpack-hot-middleware/issues/13 but it's not work.

Internet Explorer. Fake browser.

---

## Post 2 by @Nicolo_Sacchi — 2017-07-26T07:44:30Z

I think I’d use [https://github.com/remy/polyfills](https://github.com/remy/polyfills) and just call `require('polyfills/EventSource')` as early as you can in your `main.js`

---

## Post 3 by @QWp6t — 2017-07-26T12:55:18Z

I just use [polyfill.io](https://polyfill.io/), ezpz

---

## Post 4 by @ian — 2017-08-22T06:43:51Z

It actually needed to be in Webpack and not the main.js of the website. I needed to polyfill Webpack so that when I opened up the `http://localtoast:3000` URL in IE11 I wasn’t get JS errors in Webpack. In the end I gave up and went old school manual save + reload baloney.

---

## Post 5 by @Bezelinja — 2019-11-21T15:13:38Z

Hi there,

I’m experiencing the same problem with Edge. Ugghh. This is giving me much headache. Did you get it fixed? Did you figure out how to add it to web-pack?

Please help !!! :smiley:
