Registry / serialization / rollup-regenerator-runtime

rollup-regenerator-runtime

JSON →
library6.23.1jsnpmunverified

Provides the regenerator runtime as a self-contained module for bundling with Rollup. Version 6.23.1 is the latest stable release. It replaces the default babel-runtime regenerator import with a local copy, avoiding external dependencies when using async/await and generators in libraries compiled with Rollup. Key differentiator: allows bundling regenerator runtime without requiring the full babel-runtime package, reducing bundle size and avoiding issues with Rollup's module resolution.

npm install rollup-regenerator-runtime
INSTALL
IMPORT
SIG · ROLLUP-REGENERATOR
R
rollup-regenerator-runtime
serializationjavascriptv6.23.1
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–223 runs
build_error
glibc
node 18–223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

regeneratorRuntime
✓ import 'rollup-regenerator-runtime';
✗ import regeneratorRuntime from 'rollup-regenerator-runtime';
This module registers regeneratorRuntime globally as a side effect; no named or default export is provided.
default import
✓ import 'rollup-regenerator-runtime';
✗ const regeneratorRuntime = require('rollup-regenerator-runtime');
CommonJS require will return an empty object; use import for side effects.
CommonJS require
✓ require('rollup-regenerator-runtime');
✗ const regen = require('rollup-regenerator-runtime');
The module has no exports; use bare require() for side effects only.

Shows Babel configuration to replace babel-runtime regenerator with rollup-regenerator-runtime, and the import needed in the entry file.

// .babelrc { "plugins": [ "transform-regenerator", ["transform-runtime", { "helpers": false, "polyfill": false, "regenerator": true, "moduleName": "rollup-regenerator-runtime" }] ] } // In your entry file (must be imported before any async/await or generators) import 'rollup-regenerator-runtime';
Debug
Known issues
gotchaThe module must be imported (or required) as a side effect; it does not export anything. CommonJS require returns an empty object.
fix
Use `import 'rollup-regenerator-runtime';` or `require('rollup-regenerator-runtime');` without assigning to a variable.
affects: >=0.0.0
gotchaThis package only works when used as the regenerator moduleName in babel-plugin-transform-runtime. It does not function standalone.
fix
Ensure Babel configuration includes the plugins as shown in quickstart.
affects: >=0.0.0
Errors
Common errors & fixes
Module not found: Can't resolve 'regenerator-runtime' in ...
Babel transforms async/await but still imports from default 'regenerator-runtime' instead of 'rollup-regenerator-runtime'.
fix
Set `moduleName` to 'rollup-regenerator-runtime' in transform-runtime options and import 'rollup-regenerator-runtime' in your entry file.
regeneratorRuntime is not defined
The global regeneratorRuntime may not have been registered before async/await code runs.
fix
Ensure `import 'rollup-regenerator-runtime';` is placed at the top of your entry file, before any async functions.
Upgrade
Version history
6.23.1latest on npm
Audit
Dependencies
babel-plugin-transform-runtimerequiredRequired to configure the runtime plugin to use this module instead of babel-runtime
babel-plugin-transform-regeneratorrequiredTransforms async/await and generator functions into code that uses the regenerator runtime
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-regenerator-runtime — npm install rollup-regenerator-runtime · libregistry