gatsby: `gatsby develop` throwing errors with IE11
Description
When I run gatsby develop, then open my site in IE11, I immediately get an error in the console and the page doesn’t load:
'Promise' is undefined
The error is occurring in commons.js, at this location:
var enterHotUpdate = function enterHotUpdate() {
Promise.resolve(incrementHot()).then(function () {
return setTimeout(decrementHot, 0);
Note that this issue only happens with gatsby develop. If I do gatsby build, then gatsby serve, the site loads fine.
Site source code can be found here: https://github.com/joeattardi/react-snackbar-alert/tree/master/examples
Steps to reproduce
- Run
gatsby develop - Open the site in IE11
Expected result
The site should load
Actual result
A JavaScript error is thrown about 'Promise' is undefined
Environment
System: OS: macOS 10.14.5 CPU: (8) x64 Intel® Core™ i7-6700K CPU @ 4.00GHz Shell: 5.3.1 - /usr/local/bin/zsh Binaries: Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node npm: 6.9.0 - ~/.nvm/versions/node/v10.15.3/bin/npm Languages: Python: 2.7.13 - /usr/local/bin/python Browsers: Chrome: 74.0.3729.169 Firefox: 58.0.2 Safari: 12.1.1 npmPackages: gatsby: ^2.6.0 => 2.6.0 gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12 npmGlobalPackages: gatsby-cli: 2.6.2
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (4 by maintainers)
None of these suggested fixes work for me on a simple
gatsby new ie-11-test. IE 11 (run via the official MS VM in VirtualBox on a Mac) throws:This appears to be due to object destructuring:
Which (obviously) is foreign to IE 11, so I need to somehow ensure this code is run through babel.
I’m using the latest version of Gatsby:
Whoops - small typo!
that should do the trick!
If you click the link to the common.js file you can find the offending module causing the issue.
For me, it was related to arrow functions and the
query-stringmodule, so I just had to install v5 (the last version that works with IE) directly. This plus the fix above worked for me on develop.Ahh… I’ve made some progress. If I tweak @DSchau’s solution to use
react-refresh-webpack-plugininstead ofreact-hot-loaderthen it seems to work:Also getting this error
That seems to work! I have my
gatsby developrunning in IE11 now.Thank you!
@persocon I’ve not updated since dealing with this and likely won’t be given your report. 😦
I also took the approach of running
gatsby build && gatsby servewhich I appreciate will take 30s for every code change but at least you’ll be able to see your site in IE 11. Performance was virtually unusable when runninggatsby developthrough an IE11 VM anyway.I had to add this to
gatsby-node.jsto get IE11 when runninggatsby developNote: make sure you install
core-jsas a dependencyAlso do I
looks like it stumbles over arrow function.
I’m not able to use
developin IE11 either, but I get a different error:Adding the webpack config above unfortunately does not help. Any ideas?