Gatsby: IE11 Object doesn't support property or method 'assign'

Created on 9 Aug 2018  Â·  1Comment  Â·  Source: gatsbyjs/gatsby

Description

Using Gatsby with some packages, I get an error and blank page in IE11.

Steps to reproduce

Install cloudinary-react and google-maps-react. Build and view in IE11

Expected result

Page should load.

Actual result

Blank page with an error in console:
Object doesn't support property or method 'assign'

Environment

```sh
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i5-5287U CPU @ 2.90GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.7.0 - /usr/local/bin/node
Yarn: 1.9.2 - ~/.yarn/bin/yarn
npm: 6.2.0 - /usr/local/bin/npm
Browsers:
Chrome: 68.0.3440.106
Firefox: 60.0.1
Safari: 11.1.2
npmPackages:
gatsby: ^1.9.261 => 1.9.261
gatsby-image: ^1.0.51 => 1.0.51
gatsby-link: ^1.6.44 => 1.6.44
gatsby-plugin-react-helmet: ^2.0.11 => 2.0.11
gatsby-plugin-robots-txt: ^1.0.2 => 1.0.2
gatsby-plugin-sharp: ^1.6.44 => 1.6.44
gatsby-plugin-sitemap: ^1.2.25 => 1.2.25
gatsby-source-filesystem: ^1.5.36 => 1.5.36
gatsby-transformer-sharp: ^1.6.24 => 1.6.24
npmGlobalPackages:
gatsby-cli: 1.1.58
gatsby: 1.9.157

### File contents (if changed)

`gatsby-config.js`: <!-- Please use a code block or just leave it as is if wasn't changed -->

module.exports = {
siteMetadata: {
title: 'my site',
siteUrl: https://mysite.com,
},
plugins: [
gatsby-plugin-react-helmet,
'gatsby-plugin-sharp',
'gatsby-transformer-sharp',
gatsby-plugin-robots-txt,
{
resolve: 'gatsby-source-filesystem',
options: { name: 'images', path: ${__dirname}/src/images },
},
{
resolve: gatsby-plugin-sitemap,
},
],
};

`package.json`:  <!-- Please use a code block or just leave it as is if wasn't changed -->

{
"name": "my-site",
"version": "0.0.1",
"repository": {
"type": "git"
},
"description": "My Site",
"license": "MIT",
"scripts": {
"start": "npm run develop",
"build": "tailwind build ./src/layouts/index.css -c ./src/tailwind/tailwind-config.js -o ./src/tailwind/generated.css && purgecss -c purgecss.config.js -o ./src/tailwind && gatsby build",
},
"dependencies": {
"cloudinary-react": "^1.0.6",
"gatsby": "^1.9.261",
"gatsby-image": "^1.0.51",
"gatsby-link": "^1.6.44",
"gatsby-plugin-react-helmet": "^2.0.11",
"gatsby-plugin-robots-txt": "^1.0.2",
"gatsby-plugin-sharp": "^1.6.44",
"gatsby-plugin-sitemap": "^1.2.25",
"gatsby-source-filesystem": "^1.5.36",
"gatsby-transformer-sharp": "^1.6.24",
"google-maps-react": "^2.0.2",
"prop-types": "^15.6.1",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-helmet": "^5.2.0",
"react-video-cover": "^1.2.0",
"typeface-montserrat": "0.0.54"
},
"devDependencies": {
"eslint": "^4.19.1",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.11.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.8.2",
"prettier": "1.12.1",
"purgecss": "^0.21.0",
"tailwindcss": "^0.5.3"
}
}
`` gatsby-node.js: N/A <!-- Please use a code block or just leave it as is if wasn't changed --> gatsby-browser.js: N/A <!-- Please use a code block or just leave it as is if wasn't changed --> gatsby-ssr.js`: N/A

I could be not understanding but I thought Gatsby has the polyfill for Object.assign already built-in.

Most helpful comment

n/m I think I just needed to install the babel-polyfill

So:

 npm i babel-polyfill

And then import 'babel-polyfill' in my layouts/index.js

>All comments

n/m I think I just needed to install the babel-polyfill

So:

 npm i babel-polyfill

And then import 'babel-polyfill' in my layouts/index.js

Was this page helpful?
0 / 5 - 0 ratings

Related issues

totsteps picture totsteps  Â·  3Comments

brandonmp picture brandonmp  Â·  3Comments

ferMartz picture ferMartz  Â·  3Comments

kalinchernev picture kalinchernev  Â·  3Comments

rossPatton picture rossPatton  Â·  3Comments