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.

`regeneratorRuntime` is not defined

See original GitHub issue

This is a:

  • Bug Report

Which concerns:

  • flow-runtime

What is the current behaviour?

flow-runtime.min.js:3 Uncaught (in promise) ReferenceError: regeneratorRuntime is not defined
    at eval (flow-runtime.min.js:3)
    at eval (flow-runtime.min.js:3)

What is the expected behaviour?

Throw error

Please add babel-plugin-transform-runtime is your .babelrc


Which package versions are you using?

0.2.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
reaperescommented, Jan 22, 2017

In my case, I add a line of code in webpack.dev.config file. Please comments if it’s not correct.

entry: {
  app: [
    'regenerator-runtime/runtime',
    'webpack-hot-middleware/client',
    './app/index.js'
  ]
},
2reactions
ForbesLindesaycommented, Apr 29, 2017

The correct solution to this is to add https://babeljs.io/docs/plugins/transform-runtime/ to the babel config for flow-runtime. You do not need to worry about this causing a duplicate version of the regenerator runtime to exist, because flow-runtime should not be used in production anyway, and the regenerator-runtime added by babel-plugin-transform-runtime does not pollute the global scope, so it won’t conflict with any applications that use regenerator themselves. Without this, libraries that use flow-runtime will not work out of the box.

I’m going to be forced to abandon flow-runtime until this is fixed.

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
This error is caused when async/await functions are used without the proper Babel plugins. As of March 2020, the following should be all...
Read more >
ReferenceError regeneratorRuntime is not defined #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 >
Parcel, how to fix the `regeneratorRuntime is not defined` ...
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 >
regeneratorRuntime is not defined when running jest test
I got the ReferenceError: regeneratorRuntime is not defined error. ... Though, "regenerator-runtime" is present in package.json and installed.
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