In this article, we will discuss why ReferenceError: regeneratorRuntime is not defined error occurs and the steps on how to resolve it. Posting useful tips and guides for programming. Note that @babel/polyfill has been deprecated for a while. I'm building an SSR template, and when I use @babebl/register and then execute webpack (config), the system reported an error. babel-polyfill regenerator-runtime Jest Learn more about Teams What is the "ReferenceError: regeneratorRuntime is not defined" error in JavaScript? Option 1: App. # Similar to the post by arcseldon, I was running Babel within a NodeJS environment and getting the same error message ReferenceError: regeneratorRuntime is not defined. If total energies differ across different software, how do I decide which software to use? Async and await make it easier to write asynchronous code because they allow you to write asynchronous code that looks and behaves like synchronous code. Babel and regenerator-runtime are often used together to write and run code that uses async and await syntax. How do I fix the "ReferenceError: regeneratorRuntime is not defined" error in my code? Then add the following lines to webpack.config.js. This snippet must be put in .babelrc.js file (or just .babelrc if you use json). This tweet is a troll, but you must keep in mind that if you override Webpack config in CRA, you own the config, and no support will be provided. "last 3 chrome versions", To subscribe to this RSS feed, copy and paste this URL into your RSS reader. let electron = require('electron'); // electron Runtime for Regenerator-compiled generator and async functions. babel-polyfill ( deprecated as of Babel 7.4) is required. You must also install it in order to get async/await working. npm i -D babel-core babel Asking for help, clarification, or responding to other answers. Answer: The regenerator-runtime library is needed in your code because it provides the required support for asynchronous generator functions in JavaScript. Just add: