question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v2] IE 11 'Promise' is undefined error

See original GitHub issue

Description

IE 11 throws “Unhandled promise rejection ReferenceError: ‘Promise’ is undefined” error in v2 sites. This can be observed at next.gatsbyjs.org and can replicate it locally on my site. Including promise polyfill fixes the issue, but from looking at documentation babel-polyfill is meant to handle that based on defined browsers list.

Steps to reproduce

  • Open next.gatsbyjs.org in IE 11
  • Observe “Unhandled promise rejection ReferenceError: ‘Promise’ is undefined” error thrown in console longs

Expected result

No promise related errors.

Actual result

Unhandled promise rejection ReferenceError: 'Promise' is undefined
   "Unhandled promise rejection"
   {
      [functions]: ,
      __proto__: { },
      description: "'Promise' is undefined",
      message: "'Promise' is undefined",
      name: "ReferenceError",
      number: -2146823279,
      stack: "ReferenceError: 'Promise' is undefined
   at t.components.component---src-pages-index-js (https://next.gatsbyjs.org/app-ba276550eb4051a9bc0a.js:6:70060)
   at Anonymous function (https://next.gatsbyjs.org/app-ba276550eb4051a9bc0a.js:6:32261)
   at O (https://next.gatsbyjs.org/app-ba276550eb4051a9bc0a.js:24:11838)
   at S (https://next.gatsbyjs.org/app-ba276550eb4051a9bc0a.js:6:31869)
   at E (https://next.gatsbyjs.org/app-ba276550eb4051a9bc0a.js:6:32413)
   at A.getResourcesForPathname (https://next.gatsbyjs.org/app-ba276550eb4051a9bc0a.js:6:34343)
   at Anonymous function (https://next.gatsbyjs.org/app-ba276550eb4051a9bc0a.js:24:17870)
   at a (https://next.gatsbyjs.org/app-ba276550eb4051a9bc0a.js:24:10747)
   at Anonymous function (https://next.gatsbyjs.org/app-ba276550eb4051a9bc0a.js:24:10894)
   at c (https://next.gatsbyjs.org/app-ba276550eb4051a9bc0a.js:24:8307)"
   }

Environment

This is from my own site directory.

  System:
    OS: macOS High Sierra 10.13.5
    CPU: x64 Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 8.11.1 - /usr/local/bin/node
    Yarn: 1.6.0 - /usr/local/bin/yarn
    npm: 6.1.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 67.0.3396.87
    Firefox: 60.0.1
    Safari: 11.1.1
  npmPackages:
    gatsby: ^2.0.0-beta.9 => 2.0.0-beta.9 
    gatsby-plugin-glamor: ^2.0.0-beta.2 => 2.0.0-beta.2 
    gatsby-plugin-manifest: ^2.0.2-beta.2 => 2.0.2-beta.2 
    gatsby-plugin-netlify: ^2.0.0-beta.2 => 2.0.0-beta.2 
    gatsby-plugin-offline: ^2.0.0-beta.2 => 2.0.0-beta.2 
    gatsby-plugin-react-helmet: ^3.0.0-beta.2 => 3.0.0-beta.2 
    gatsby-plugin-sitemap: ^2.0.0-beta.2 => 2.0.0-beta.2 
  npmGlobalPackages:
    gatsby-cli: 2.0.0-beta.1

File contents (if changed)

gatsby-config.js: N/A package.json: N/A gatsby-node.js: N/A gatsby-browser.js: N/A gatsby-ssr.js: N/A

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

16reactions
superbullcommented, May 29, 2019

This error still exists during development, with Gatsby develop.

Production is OK, with Gatsby build.

Gatsby version: 2.6.2

5reactions
johndaskovskycommented, Nov 1, 2019

We’re running Gatsby 2.13.83 in production and are seeing this issue on IE11

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Error Promise is undefined in IE11 - Stack Overflow
Stack Overflow for Teams – Start collaborating and sharing organizational knowledge.
Read more >
"'Promise' is undefined" error in IE11 even though targeting ES5
Runs without error in IE11. Actual behavior. Fails in IE 11 with error SCRIPT5009: 'Promise' is undefined . Only works in IE 11...
Read more >
'Promise' is undefined in Internet Explorer (IE 11) - Syncfusion
We suspect that you haven't referred the ES6 Promise polyfill script in your html page which cause this issue in IE11 browser.
Read more >
'Promise' is undefined in IE11 WordPress
'Promise' is undefined in IE11 WordPress ... Now the problem is, the popups are loading fine on Homepage but not on other pages...
Read more >
JavaScript runtime error: 'Promise' is undefined in IE
While using IE11 it return JavaScript runtime error: 'Promise' is undefined in webdatarocks.js file. Please suggest resolve this issue.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found