Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Add EventSource polyfill so that webpack HMR can work on IE/Edge #365

Description

@SteveSandersonMS

Currently, HMR fails on IE/Edge because http://caniuse.com/#feat=eventsource

Activity

  1. MarkPieszak commented on Oct 6, 2016

    @MarkPieszak
    Contributor

    Is this something new they implemented? Thought it always worked with IE!

  2. jongalloway commented on Oct 6, 2016

    @jongalloway

    EventSource doesn't work in IE, and is still just in "Under Consideration" status for Edge.

    I've looked at this a bit before, I think this might be the most popular polyfill - it's been maintained for 4+ years and supports a lot of browsers, including IE11 and Edge.

  3. SteveSandersonMS commented on Oct 10, 2016

    @SteveSandersonMS
    MemberAuthor

    Thanks @jongalloway - have added that one and it works.

  4. added a commit that references this issue on Oct 10, 2016
  5. JohnGalt1717 commented on Nov 1, 2016

    @JohnGalt1717

    I'm confused. I just downloaded the template pack and started it up in IE and Edge and neither have the event-source polyfill added by default. I added it to the webpack.config.vendor.js manually and there's no difference.

  6. antmdvs commented on Nov 1, 2016

    @antmdvs

    and neither have the event-source polyfill

    How do you know this? Are you seeing this message in the browser's console when you refresh your page?

    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

  7. JohnGalt1717 commented on Nov 1, 2016

    @JohnGalt1717

    Yes I'm seeing the message in the browser console in both Edge and IE.

    Yes I should include a polyfill. Actually a Microsoft development effort should include the polyfill by default because you know YOUR browsers don't work without it and telling people to use GOOGLE'S browser in a Microsoft development environment is STUPID on Microsoft's part because it ensures that developers don't need your tools at all and thus have no reason to develop on Windows or use Visual Studio. But I digress...

    As I noted I added the npm for eventsource-polyfill from the page you noted and then put it in the webpack.vendor.config.js file in the vendors section. It doesn't complain but after rebuilding the webpack file and running it again, there is no difference at all and the error message still shows up in the console for both IE and Edge.

    So yes, your templates should have this and any other polyfills for IE 11+ development installed automatically. (or at the very least give a options box when you create the template) Further if you're going to instruct someone to "include a polyfill" it might be helpful to tell them HOW to do so given the complexity of how this project is setup versus instructional materials on webpack's site, and even MVC.net etc.

  8. SteveSandersonMS commented on Nov 1, 2016

    @SteveSandersonMS
    MemberAuthor

    The latest template does include the event-source polyfill - it's just not published to the VS gallery yet.

    If you want to run the latest template, please use the Yeoman generator (npm install -g yo generator-aspnetcore-spa then run yo aspnetcore-spa).

  9. dkent600 commented on Jul 14, 2017

    @dkent600

    @SteveSandersonMS I am using the latest template (for Aurelia) and it does not include a dependency on the eventsource-polyfill.

    .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions