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

I’m getting the following error when trying to use this package on node 4.4.7. From what I can see after googling around a bit, this may require babel-polyfill or similar. I’m not familiar with babel otherwise I’d attempt to put up a pull request.

  ● Test suite failed to run

    ReferenceError: regeneratorRuntime is not defined

      at node_modules/mongodb-memory-server/lib/MongoMemoryServer.js:10:32
      at Object.<anonymous> (node_modules/mongodb-memory-server/lib/MongoMemoryServer.js:44:2)
      at Object.<anonymous> (node_modules/mongodb-memory-server/lib/index.js:8:26)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:20 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
nodkzcommented, Aug 17, 2017

Please install new mongodb-memory-server@1.4.1 and update your code in such way:

- var MongodbMemoryServer = require('mongodb-memory-server');
+ var MongodbMemoryServer = require('mongodb-memory-server').default;

When you remove babel, the require method loose default export. So without babel, you should do it explicitly require('mongodb-memory-server').default.

1reaction
sibeliuscommented, Aug 2, 2017

you should add this

import 'babel-polyfill' on top of your tests

Read more comments on GitHub >

github_iconTop Results From Across the Web

Babel 6 regeneratorRuntime is not defined - Stack Overflow
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 >
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 >
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 >
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 >
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