quantizor / buttermilk

beautifully simple isomorphic routing for React projects
https://buttermilk.js.org/
MIT License
110 stars 6 forks source link

Internet Explorer requires Event polyfill #16

Closed nerdstep closed 5 years ago

nerdstep commented 5 years ago

Internet Explorer breaks due to usage of the new Event constructor.

It works fine after adding a polyfill, but it was somewhat difficult to track this issue down since the error appears as originating in react-dom, and at least with a Create React App bootstrapped app, you can't easily test IE in development.

So testing the production build you get this useful error:

SCRIPT445: Object doesn't support this action
react-dom.production.min.js (169,13)

Initially I was trying to figure out why Babel/core-js wasn't polyfilling this but it seems they're not focused on DOM related APIs.

Anyway, I'm opening this issue because it might help others avoid similar grief trying to debug the problem. Perhaps a quick mention in the README would be warranted?

quantizor commented 5 years ago

Ooh interesting. Thanks for surfacing this! Would you be interested in doing a readme PR?

nerdstep commented 5 years ago

Sure thing!

As a point of further discussion, it might be more "correct" to use the CustomEvent API instead of Event.

Either way, both require a polyfill to support IE, though it is fairly minimal.