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.

ReferenceError: regeneratorRuntime is not defined

See original GitHub issue

After upgrading from 2.4.1 to 2.4.2, I’m now seeing the following error:

ReferenceError: regeneratorRuntime is not defined

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
onukselcukcommented, Nov 14, 2019

I’ve encountered the same problem. My solution was very similar to @Tassfighter . Here is my solution I’m using Next JS, for Next JS Add these to your package.json "dependencies": { "core-js": "^3.3.5", "regenerator-runtime": "^0.13.3" }, "devDependencies": { "@babel/core": "^7.6.4", }

my .babelrc file { "presets": [["next/babel", { "useBuiltIns":"entry", "corejs":3 }]] } in _document.js import these import "core-js"; import regeneratorRuntime from "regenerator-runtime";

For normal setups other than Next JS, below is the configuration Add these to your package.json "dependencies": { "core-js": "^3.3.5", "regenerator-runtime": "^0.13.3" }, "devDependencies": { "@babel/core": "^7.6.4", "@babel/preset-env": "^7.6.3" }

my .babelrc file { "presets": [["@babel/preset-env", { "useBuiltIns":"usage", "corejs":3 }]] }

If you are using “usage” option you don’t need to import core-js and regenerator-runtime, but Next JS creates a problem if you are using “usage” option. You need to use “entry” option and import the files in Next JS.

3reactions
eluchsingercommented, Mar 7, 2020

@Tassfighter this library should list all their dependencies. And if another library uses a different version of regeneratorRuntime, it will be handled as it is handled with all other libraries. It’s a common issue. The behavior as it is now is a bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix regeneratorRuntime is not defined?
I have ran into a problem, the error is regeneratorRuntime is not defined while working with React and Parcel bundler.
Read more >
Babel 6 regeneratorRuntime is not defined - Stack Overflow
This only works because it no longer transforms async/await and thus no longer needs the regeneratorRuntime and because it's not transformed it ...
Read more >
ReferenceError regeneratorRuntime is not defined · Issue #9849
I'm building an SSR template, and when I use @babebl/register and then execute webpack (config), the system reported an error.
Read more >
regeneratorRuntime is not defined when running jest test
I got the ReferenceError: regeneratorRuntime is not defined error. Please attach your logs beforehand. ○ Test suite failed to run ReferenceError: ...
Read more >
Parcel, how to fix the `regeneratorRuntime is not defined` error
I run into this problem in a project using Babel as soon as I added an async function, but the problem is the...
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