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

ReferenceError: regeneratorRuntime is not defined #4590

Closed
benjaminhoffman opened this issue Mar 18, 2018 · 6 comments
Closed

ReferenceError: regeneratorRuntime is not defined #4590

benjaminhoffman opened this issue Mar 18, 2018 · 6 comments

Comments

@benjaminhoffman
Copy link
Contributor

Description

Adding async/await to Gatsby's blog creates this error:

email-capture-form.js:46 Uncaught (in promise) ReferenceError: regeneratorRuntime is not defined

After searching the issues, I've seen this pop up a couple times.

This line is throwing the error: https://github.com/gatsbyjs/gatsby/pull/4589/files#diff-0b944fc95fef100bc9dd4aa6fbcb4647R44

@m-allanson
Copy link
Contributor

Hey @benjaminhoffman 👋 I think this can be fixed with the following steps: #3931 (comment)

@benjaminhoffman
Copy link
Contributor Author

Hey @m-allanson ! Thanks for the comment. Sadly, I'm not sure if that did the trick. :( . I followed that step for both gatsby and for my plugin.

The branch is mailchimp2 and here is the diff: https://github.com/gatsbyjs/gatsby/compare/master...benjaminhoffman:mailchimp2?expand=1

Do you have a moment to pull down my branch? My steps:

git checkout -b mailchimp2
git pull origin mailchimp2
cd www
rm -rf .cache public node_modules
yarn install
yarn build
yarn serve

Then I load this page: http://localhost:9000/blog/2018-03-07-why-we-created-the-plugin-library/

The error still shows in the console. Any other guesses on what it can be?

@m-allanson
Copy link
Contributor

I've had a look at this and got as far as confirming the error using your above repro steps. But I haven't had a chance to dig any further yet.

I'd like to come back and work out a fix for this issue later. In the interest of getting your PR going again it may be worth writing the offending method with Promises instead of async / await, particularly as async / await isn't used anywhere else in the Gatsby site.

@benjaminhoffman
Copy link
Contributor Author

refactored to using then/catch instead of async/await . thx for the rec @m-allanson !
#4589

closing this.

@thebarty
Copy link

thebarty commented May 9, 2018

Just ran into the same error. It sucks…

@dominiceden
Copy link

Switching to .then() instead of async/await fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants