Skip to content
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

Opt into Babel transpilation in gatsby-plugin-theme-ui (?) #1598

Closed
aaronadamsCA opened this issue Mar 24, 2021 · 3 comments
Closed

Opt into Babel transpilation in gatsby-plugin-theme-ui (?) #1598

aaronadamsCA opened this issue Mar 24, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@aaronadamsCA
Copy link
Contributor

aaronadamsCA commented Mar 24, 2021

I'm getting an IE 11 error on my Gatsby production site, despite using its standard Babel config that should support IE 11.

This line is responsible:

document.documentElement.classList.forEach((className) => {

Unfortunately IE 11 doesn't implement NodeList.forEach.

It should be possible for a module to opt into Gatsby's Babel transpilation by adjusting its Webpack configuration in gatsby-node.js. I think that would be a good feature to add to gatsby-plugin-theme-ui, to opt in theme-ui and @theme-ui/*, so that the theme is always transpiled by Babel to be compatible with the set of browsers defined in the site's Babel configuration.

As far as I can tell, since Gatsby v3 includes core-js v3, and core-js v3 includes a polyfill for NodeList.forEach, this should be working out of the box. 🤷‍♂️

@aaronadamsCA aaronadamsCA changed the title Opt into Babel transpilation in gatsby-plugin-theme-ui Opt into Babel transpilation in gatsby-plugin-theme-ui (?) Mar 25, 2021
@hasparus hasparus added the bug Something isn't working label Mar 26, 2021
@hasparus
Copy link
Member

Thanks for the issue, @aaronadamsCA!

@aaronadamsCA
Copy link
Contributor Author

No problem @hasparus, after further investigation I got the feeling it was upstream:

gatsbyjs/gatsby#30473

Looks like it'll be fixed in the next Gatsby point release. 👍

@aaronadamsCA
Copy link
Contributor Author

Gatsby has fixed the upstream problem, and Theme UI no longer supports IE 11 anyway, so I'm closing this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants