{"id":22306,"library":"rollup-regenerator-runtime","title":"rollup-regenerator-runtime","description":"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.","status":"active","version":"6.23.1","language":"javascript","source_language":"en","source_url":"https://github.com/ForbesLindesay/rollup-regenerator-runtime","tags":["javascript"],"install":[{"cmd":"npm install rollup-regenerator-runtime","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-regenerator-runtime","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-regenerator-runtime","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required to configure the runtime plugin to use this module instead of babel-runtime","package":"babel-plugin-transform-runtime","optional":false},{"reason":"Transforms async/await and generator functions into code that uses the regenerator runtime","package":"babel-plugin-transform-regenerator","optional":false}],"imports":[{"note":"This module registers regeneratorRuntime globally as a side effect; no named or default export is provided.","wrong":"import regeneratorRuntime from 'rollup-regenerator-runtime';","symbol":"regeneratorRuntime","correct":"import 'rollup-regenerator-runtime';"},{"note":"CommonJS require will return an empty object; use import for side effects.","wrong":"const regeneratorRuntime = require('rollup-regenerator-runtime');","symbol":"default import","correct":"import 'rollup-regenerator-runtime';"},{"note":"The module has no exports; use bare require() for side effects only.","wrong":"const regen = require('rollup-regenerator-runtime');","symbol":"CommonJS require","correct":"require('rollup-regenerator-runtime');"}],"quickstart":{"code":"// .babelrc\n{\n  \"plugins\": [\n    \"transform-regenerator\",\n    [\"transform-runtime\", {\n      \"helpers\": false,\n      \"polyfill\": false,\n      \"regenerator\": true,\n      \"moduleName\": \"rollup-regenerator-runtime\"\n    }]\n  ]\n}\n\n// In your entry file (must be imported before any async/await or generators)\nimport 'rollup-regenerator-runtime';","lang":"javascript","description":"Shows Babel configuration to replace babel-runtime regenerator with rollup-regenerator-runtime, and the import needed in the entry file."},"warnings":[{"fix":"Use `import 'rollup-regenerator-runtime';` or `require('rollup-regenerator-runtime');` without assigning to a variable.","message":"The module must be imported (or required) as a side effect; it does not export anything. CommonJS require returns an empty object.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure Babel configuration includes the plugins as shown in quickstart.","message":"This package only works when used as the regenerator moduleName in babel-plugin-transform-runtime. It does not function standalone.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'6.23.1':20 'allow':54 'async/await':44 'avoid':39,70 'babel':31,63 'babel-runtim':30,62 'bundl':16,55,67 'compil':49 'contain':13 'copi':38 'default':29 'depend':41 'differenti':53 'extern':40 'full':61 'generat':46 'import':34 'issu':71 'javascript':77 'key':52 'latest':23 'librari':48 'local':37 'modul':14,75 'packag':65 'provid':5 'reduc':66 'regener':3,7,33,56 'releas':25 'replac':27 'requir':59 'resolut':76 'rollup':2,18,51,73 'rollup-regenerator-runtim':1 'runtim':4,8,32,57,64 'self':12 'self-contain':11 'size':68 'stabl':24 'use':43 'version':19 'without':58","created_at":"2026-04-27T17:04:28.893109+00:00","updated_at":"2026-04-27T17:04:28.893109+00:00","problems":[{"fix":"Set `moduleName` to 'rollup-regenerator-runtime' in transform-runtime options and import 'rollup-regenerator-runtime' in your entry file.","cause":"Babel transforms async/await but still imports from default 'regenerator-runtime' instead of 'rollup-regenerator-runtime'.","error":"Module not found: Can't resolve 'regenerator-runtime' in ..."},{"fix":"Ensure `import 'rollup-regenerator-runtime';` is placed at the top of your entry file, before any async functions.","cause":"The global regeneratorRuntime may not have been registered before async/await code runs.","error":"regeneratorRuntime is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ForbesLindesay/rollup-regenerator-runtime","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-regenerator-runtime","openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}