Reputation: 2558
Say I wanted to support IE11 (and sadly, I do), how would I go about making gatsby develop
work on that poor old browser?
Right now, I get this message:
webpack-hot-middleware's client requires EventSource to work.
This polyfill looks promising, but that's as far as I've made it.
Any help?
P.S. Probably worth mentioning that I'm using Gatsby v 2.4.7
Upvotes: 1
Views: 2217
Reputation: 11
Can confirm on my project that running gatsby develop
doesn't make it work for IE11, but using gatsby build
does. When running gatsby develop
, all I could see on IE11 is a blank page.
Upvotes: 1
Reputation: 43402
Looks like Gatsby doesn't support IE in development, only in production, so no polyfills will be added and IE will error when using gatsby develop
.
https://www.gatsbyjs.org/packages/babel-preset-gatsby/
Upvotes: 1
Reputation: 11335
As per the documentation of Gatsby, You need to use babel 7.
Babel helps ensure the JavaScript you write works across different browsers (including older versions of Internet Explorer).
Reference:
Gatsby leverages Babel 7’s ability to automatically add polyfills for your target browsers.
Newer browsers support more JavaScript APIs than older browsers. For older versions, Gatsby (via Babel) automatically adds the minimum “polyfills” necessary for your code to work in those browsers.
If you start using a newer JavaScript API like [].includes that isn’t supported by some of your targeted browsers, you won’t have to worry about it breaking the older browsers as Babel will automatically add the needed polyfill core-js/modules/es7.array.includes.
Reference:
Upvotes: 0