-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gatsby develop
throwing errors with IE11
#14502
Comments
Also getting this error |
Interesting! This shouldn't have been new, but does appear to be coming from react-hot-loader. Specifically, we do provide some polyfills for IE, notably the event-source-polyfill However, it doesn't look like we're loading any polyfills in development (and also we're using @babel/preset-env I think this is something we'll want to iron out, but in the interim, does the following work as a workaround for this use case? You'll want to edit exports.onCreateWebpackConfig = function onCreateWebpackConfig({ actions, stage, loaders }) {
if (stage === 'develop') {
actions.setWebpackConfig({
module: {
rules: [
{
test: /react-hot-loader/,
use: [
loaders.js()
]
}
]
}
})
}
} |
@DSchau I will try this out later this evening and report back. Thanks! |
@DSchau I tried adding this to
|
Whoops - small typo! exports.onCreateWebpackConfig = function onCreateWebpackConfig({ actions, stage, loaders }) {
if (stage === 'develop') {
actions.setWebpackConfig({
module: {
rules: [
{
test: /react-hot-loader/,
use: [
loaders.js()
]
}
]
}
})
}
} that should do the trick! |
That seems to work! I have my Thank you! |
I'm not able to use
Adding the webpack config above unfortunately does not help. Any ideas? |
Also do I
looks like it stumbles over arrow function. |
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 |
Hi @himynameistimli , how do i know which module causing the issue ? |
I've been wrestling with this issue for days! Thanks so much for that! |
I had to add this to Note: make sure you install
|
@lablancas Thanks, that worked for development, but when I got to build the site and test on ie11 I get errors again. Did you have the same issue? |
@greatwitenorth no. I have my site working on IE11 and it's live. What errors are you getting from IE11? |
None of these suggested fixes work for me on a simple
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: $ gatsby --version
Gatsby CLI version: 2.8.29
Gatsby version: 2.19.43 |
Ahh.... I've made some progress. If I tweak @DSchau's solution to use exports.onCreateWebpackConfig = function onCreateWebpackConfig({
actions,
stage,
loaders,
}) {
if (stage === "develop") {
actions.setWebpackConfig({
module: {
rules: [
{
test: /react-refresh-webpack-plugin/,
use: [loaders.js()],
},
],
},
})
}
} |
sadly this doesn't work for me, on the 2.20.22 version, |
@persocon I've not updated since dealing with this and likely won't be given your report. :( I also took the approach of running |
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:The error is occurring in
commons.js
, at this location:Note that this issue only happens with
gatsby develop
. If I dogatsby build
, thengatsby 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
gatsby develop
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(R) Core(TM) 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
The text was updated successfully, but these errors were encountered: