Gatsby: Develop failure: ReferenceError: regeneratorRuntime is not defined

Created on 17 Aug 2017  路  8Comments  路  Source: gatsbyjs/gatsby

when I add gatsby-source-contentful in plugins, I get error:
screen shot 2017-08-17 at 4 03 32 pm
the gatsby-config.js is like:
screen shot 2017-08-17 at 5 01 40 pm

Most helpful comment

@Jaikant Your issue looks like in the browser app you've not included the babel-polyfill or regenerator-runtime

Try adding the below to gatsby-browser.js

exports.onClientEntry = () => {
  require('babel-polyfill')
}

https://www.gatsbyjs.org/docs/browser-apis/

All 8 comments

This issue should be fixed now.

Update to the latest version.

I still have this problem after upgrading to Gatsby v1.8.16. Tried nuking .cache but no change.

I started getting the error when I added an async function to my code. Am I supposed to install the babel runtime or is this a bug in Gatsby?

I've got exactly the same issue as @whmountains . I'm using gatsby with typescript and it happens when I want to use async functions.

How did you fix it, @pie6k ?

I didn't. @auser

I am facing the same error, any suggestions!

Uncaught (in promise) ReferenceError: regeneratorRuntime is not defined
    at Login.js:53
    at Login.js:65
    at Object../src/containers/Login.js (Login.js:102)
    at __webpack_require__ (bootstrap e58e01e5cf6cfda1fba5:555)
    at fn (bootstrap e58e01e5cf6cfda1fba5:86)
    at Object../src/pages/login.js (login.js:1)
    at __webpack_require__ (bootstrap e58e01e5cf6cfda1fba5:555)
    at fn (bootstrap e58e01e5cf6cfda1fba5:86)
    at Object../.cache/sync-requires.js (sync-requires.js:15)
    at __webpack_require__ (bootstrap e58e01e5cf6cfda1fba5:555)

@Jaikant Your issue looks like in the browser app you've not included the babel-polyfill or regenerator-runtime

Try adding the below to gatsby-browser.js

exports.onClientEntry = () => {
  require('babel-polyfill')
}

https://www.gatsbyjs.org/docs/browser-apis/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimfilippou picture jimfilippou  路  3Comments

totsteps picture totsteps  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

andykais picture andykais  路  3Comments

dustinhorton picture dustinhorton  路  3Comments