Gatsby: ReferenceError: Can't find variable: Set

Created on 4 Jan 2019  路  3Comments  路  Source: gatsbyjs/gatsby

Description

I only experience this bug for my Gatsby application running in production. Seems like there is a missing polyfill for this to work on all devices?

ReferenceError: Can't find variable: Set
  at None (./node_modules/react-dom/cjs/react-dom.production.min.js:107:190)

Found only one similar issue for it on SO.

My dependencies:

    "@mdx-js/mdx": "^0.15.0",
    "@mdx-js/tag": "^0.15.0",
    "axios": "^0.18.0",
    "disqus-react": "^1.0.5",
    "dotenv": "^6.2.0",
    "gatsby": "^2.0.75",
    "gatsby-image": "^2.0.25",
    "gatsby-link": "^2.0.7",
    "gatsby-mdx": "^0.2.0",
    "gatsby-plugin-catch-links": "^2.0.9",
    "gatsby-plugin-feed": "^2.0.11",
    "gatsby-plugin-google-analytics": "^2.0.8",
    "gatsby-plugin-manifest": "^2.0.12",
    "gatsby-plugin-offline": "^2.0.20",
    "gatsby-plugin-react-helmet": "^3.0.5",
    "gatsby-plugin-sentry": "^1.0.0",
    "gatsby-plugin-sharp": "^2.0.16",
    "gatsby-plugin-sitemap": "^2.0.3",
    "gatsby-plugin-styled-components": "^3.0.4",
    "gatsby-remark-copy-linked-files": "^2.0.8",
    "gatsby-remark-images": "^3.0.1",
    "gatsby-remark-prismjs": "^3.1.4",
    "gatsby-source-filesystem": "^2.0.12",
    "gatsby-transformer-remark": "^2.1.17",
    "gatsby-transformer-sharp": "^2.1.9",
    "prismjs": "^1.15.0",
    "react": "next",
    "react-dom": "next",
    "react-facebook-pixel": "^0.1.1",
    "react-helmet": "~5.2.0",
    "react-quora-pixel": "0.0.5",
    "react-twitter-conversion-tracker": "^1.0.0",
    "react-youtube": "^7.8.0",
    "styled-components": "^4.1.3"

Steps to reproduce

Didn't experience it on my local machine, but Sentry.io reported it. It happened on a Windows 7 machine with Firefox 43.0.

question or discussion

Most helpful comment

Hello,

I am having the same issue with iOS 7 and using browserlist still doesn't solve the problem.

"browserslist": [ ">0.25%", "iOS 7", "not dead" ],

Can anyone help me figure this out?

All 3 comments

Hey @rwieruch

I'm pretty sure firefox 43 doesn't support Set and you're right in that it seems the polyfill isn't available.

Polyfilling in Gatsby is controlled by using a browserslist key within your
package.json.

By default Gatsby emulates the following config:

javascript:title=package.json { "browserslist": [ ">0.25%", "not dead" ] }

This as you can see in https://browserl.ist/?q=%3E0.25%25%2C+not+dead does not include firefox 43.

If you'd like to support firefox 43, please add a custom browserslist including it.

Read more at https://www.gatsbyjs.org/docs/browser-support/

Oh, thank you! Didn't know about the browserList configuration. Will check this out 馃憤 馃挴

Hello,

I am having the same issue with iOS 7 and using browserlist still doesn't solve the problem.

"browserslist": [ ">0.25%", "iOS 7", "not dead" ],

Can anyone help me figure this out?

Was this page helpful?
0 / 5 - 0 ratings