{"id":18988,"library":"babel-es6-polyfill","title":"babel-es6-polyfill","description":"A lightweight ES6/ES2015 polyfill specifically for Babel, version 1.1.0, designed for modern browsers that fully support ES5. Unlike Babel's default polyfill, it includes only standardized features from the ECMAScript specification, omitting proposals (e.g., setImmediate) and non-standard additions. This polyfill is intended for browser-only use, replacing babel-core's browser-polyfill.js. It has low release cadence with minimal updates. Key differentiators: pure standards track, no ES5 shims, and no proposals.","status":"deprecated","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/JasonBerry/babel-es6-polyfill","tags":["javascript","es6","ecmascript 6","es2015","babel","shim","polyfill"],"install":[{"cmd":"npm install babel-es6-polyfill","lang":"bash","label":"npm"},{"cmd":"yarn add babel-es6-polyfill","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-es6-polyfill","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This is a browser polyfill file, not a module. Use require to load the file or include via script tag. ESM imports may not work as expected.","wrong":"import polyfill from 'babel-es6-polyfill';","symbol":"default","correct":"const polyfill = require('babel-es6-polyfill/dist/browser-polyfill.js');"},{"note":"The polyfill file is located under dist/. The package does not export any symbols; it's a side-effect script.","wrong":"<script src=\"node_modules/babel-es6-polyfill/browser-polyfill.js\"></script>","symbol":"browser-polyfill.js","correct":"<script src=\"node_modules/babel-es6-polyfill/dist/browser-polyfill.js\"></script>"},{"note":"No named exports exist. The polyfill executes immediately when loaded.","wrong":"const { Polyfill } = require('babel-es6-polyfill');","symbol":"Polyfill","correct":"const polyfill = require('babel-es6-polyfill/dist/browser-polyfill.js');"}],"quickstart":{"code":"// Include before compiled Babel code\nconst polyfill = require('babel-es6-polyfill/dist/browser-polyfill.js');\n// Alternatively, in HTML:\n// <script src=\"node_modules/babel-es6-polyfill/dist/browser-polyfill.js\"></script>\n// Then your compiled Babel code can use ES6 features like Promise, Map, Set, etc.\nconst map = new Map();\nmap.set('key', 'value');\nconsole.log(map.get('key')); // 'value'","lang":"javascript","description":"Shows how to load the polyfill via require in a Node-like environment (e.g., webpack) and verify Map works."},"warnings":[{"fix":"Use @babel/polyfill or import core-js/stable and regenerator-runtime/runtime.","message":"This package is deprecated in favor of @babel/polyfill (now @babel/polyfill-noop or core-js usage).","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use core-js for Node.js polyfilling.","message":"Polyfill only works in browsers; it may fail in Node.js due to missing DOM APIs.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Ensure browsers are ES5-compatible or include an ES5 polyfill first.","message":"The polyfill does not include ES5 shims; it assumes target browsers support ES5 fully.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use core-js-compat to include necessary features based on target browsers.","message":"No proposals are included (e.g., Array.prototype.includes is ES2016, not ES6). Users may expect newer features.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Load the polyfill script before any compiled Babel output. Use <script src=\"...babel-es6-polyfill/dist/browser-polyfill.js\"></script> at the top of your HTML.","cause":"babel-es6-polyfill not loaded before Babel-compiled code.","error":"ReferenceError: Map is not defined"},{"fix":"Run npm install babel-es6-polyfill --save and ensure the path is correct: require('babel-es6-polyfill/dist/browser-polyfill.js').","cause":"Missing installation or incorrect path.","error":"Cannot find module 'babel-es6-polyfill'"},{"fix":"Include the polyfill script as the very first script tag, before any other scripts.","cause":"Older browser lacks ES6 support and polyfill not loaded.","error":"Uncaught TypeError: ... is not a function (e.g., Promise is undefined)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}