Categories
JavaScript Answers

How to fix Babel 7 – ReferenceError: regeneratorRuntime is not defined with JavaScript?

Spread the love

To fix Babel 7 – ReferenceError: regeneratorRuntime is not defined with JavaScript, we install a few packages and then import them into our project.

We install the missing packages with

npm install --save core-js
npm install --save regenerator-runtime    

And then import them with

import "core-js/stable";
import "regenerator-runtime/runtime";

to let us use Babel in our project.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *