{"id":27058,"library":"idempotent-babel-polyfill","title":"idempotent-babel-polyfill","description":"A tiny utility that allows importing babel-polyfill multiple times without causing duplicate initialization errors. Version 7.4.4 is the latest stable release; the package has seen no updates since 2018 and effectively acts as a polyfill wrapper for legacy Babel setups. It provides an idempotent import that checks if core-js or regenerator-runtime has already been loaded, preventing multiple polyfill application which can cause conflicts and performance issues. Unlike directly importing babel-polyfill, this package is safe to include in library code where consumers may also polyfill.","status":"maintenance","version":"7.4.4","language":"javascript","source_language":"en","source_url":"https://github.com/codejamninja/idempotent-babel-polyfill","tags":["javascript"],"install":[{"cmd":"npm install idempotent-babel-polyfill","lang":"bash","label":"npm"},{"cmd":"yarn add idempotent-babel-polyfill","lang":"bash","label":"yarn"},{"cmd":"pnpm add idempotent-babel-polyfill","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime peer dependency; the package wraps babel-polyfill.","package":"babel-polyfill","optional":false}],"imports":[{"note":"The default import is a side-effect import that loads and executes the polyfill; named exports require object destructuring.","wrong":"import idempotentBabelPolyfill from 'idempotent-babel-polyfill'","symbol":"default import (side-effect)","correct":"import 'idempotent-babel-polyfill'"},{"note":"The named export is a function that triggers the polyfill manually; it is not the default export.","wrong":"import idempotentBabelPolyfill from 'idempotent-babel-polyfill'","symbol":"idempotentBabelPolyfill","correct":"import { idempotentBabelPolyfill } from 'idempotent-babel-polyfill'"},{"note":"CJS require works fine; no need for destructuring. The package supports both ESM and CJS.","wrong":null,"symbol":"require","correct":"require('idempotent-babel-polyfill')"}],"quickstart":{"code":"// Install: npm install idempotent-babel-polyfill\n\n// Option 1: Import as side-effect (recommended)\nimport 'idempotent-babel-polyfill';\n\n// Option 2: Use require\nrequire('idempotent-babel-polyfill');\n\n// Option 3: Call the exported function manually\nimport { idempotentBabelPolyfill } from 'idempotent-babel-polyfill';\nidempotentBabelPolyfill();","lang":"javascript","description":"Shows three ways to use the package: side-effect import, require, and calling the exported function."},"warnings":[{"fix":"Replace with direct imports: import 'core-js/stable'; import 'regenerator-runtime/runtime';","message":"babel-polyfill is deprecated in favor of core-js/stable and regenerator-runtime/runtime.","severity":"deprecated","affected_versions":">=7.4.0"},{"fix":"Use core-js directly or @babel/preset-env with useBuiltIns.","message":"Package hasn't been updated since 2018; may be incompatible with modern Babel 7.4+.","severity":"breaking","affected_versions":">=7.4.0"},{"fix":"Ensure no other polyfill is loaded before this import.","message":"Importing idempotent-babel-polyfill multiple times still loads babel-polyfill once, but babel-polyfill itself may cause duplicate if already present.","severity":"gotcha","affected_versions":"all"},{"fix":"Use dedupe tools or better: use core-js directly with proper configuration.","message":"The package does not guarantee idempotency if used in bundled environments with multiple copies.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install babel-polyfill","cause":"babel-polyfill is not installed as a dependency.","error":"Error: Cannot find module 'babel-polyfill'"},{"fix":"Use idempotent-babel-polyfill to safely import only once.","cause":"Multiple imports of babel-polyfill in the same application.","error":"Attempted to load multiple Babel polyfills, which may cause issues."},{"fix":"Install babel-polyfill as a direct dependency.","cause":"Using idempotent-babel-polyfill in an environment where babel-polyfill is not available.","error":"Requested path: babel-polyfill not found in module map"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}