Plugins: regeneratorRuntime is not defined with babelHelpers: 'bundled'

Created on 10 Sep 2020  Ā·  4Comments  Ā·  Source: rollup/plugins

Expected Behavior

I would think regenerator-runtime would be included in the bundle with the option babelHelpers: bundled but that doest not seem to be the case.

Actual Behavior

ReferenceError: regeneratorRuntime is not defined

The regenerator runtime is not bundled.

Additional Information

https://repl.it/repls/CarefulNoxiousSysadmin#rollup.config.js

Related: #356

c⁵ ā‹… question šŸ”Œ plugin-babel

All 4 comments

This is how Babel works - regeneratorRuntime is not considered a helper, it doesn't come from Babel's core implementation but from the external module. You should either make it available globally or use @babel/plugin-transform-runtime appropriately: https://babeljs.io/docs/en/babel-plugin-transform-runtime#regenerator

I am having this issue as well, how do I inject regenerator-runtime/runtime on top of my bundle without importing it directly from the library? (I have some builds with babel and some builds without)

@marcofugaro please refrain from "me too" replies, and this is not the place for support.

@marcofugaro how about use babelHelpers: runtime ?

Was this page helpful?
0 / 5 - 0 ratings