Parcel - Uncaught ReferenceError: regeneratorRuntime

·Tech·No AI

I’ve migrated an application from create-react-app to Parcel (v1) which contains await/async.

I’ve got this error during the build process:

Uncaught ReferenceError: regeneratorRuntime

How to fix it? You need @babel/plugin-transform-runtime with regenerator=True (it’s True by default, documentation).

Terminal window
npm install --save-dev @babel/runtime @babel/plugin-transform-runtime

Create or update .babelrc file.

{
"plugins": ["@babel/plugin-transform-runtime"]
}

It should work now.

Spot something wrong?

Found a typo, a broken link, or something that could be better? I would love to hear from you. Drop me a message and I will fix it.