{"record":{"id":"2edd50e7d21e942f","repo":"vuejs/vue-cli","slug":"cannot-find-polyfill-item-please-refer-to-cor","errorCode":null,"errorMessage":"Cannot find polyfill ${item}, please refer to 'core-js-compat' for a complete list of available modules","messagePattern":"Cannot find polyfill (.+?), please refer to 'core-js-compat' for a complete list of available modules","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@vue/babel-preset-app/index.js","lineNumber":90,"sourceCode":"      ]\n    },\n    { ignoreBrowserslistConfig: true }\n  )\n\n  // use the intersection of browsers supporting Web Components and user defined targets config\n  return getIntersectionTargets(targets, allWCTargets)\n}\n\nfunction getPolyfills (targets, includes) {\n  // if no targets specified, include all default polyfills\n  if (!targets || !Object.keys(targets).length) {\n    return includes\n  }\n\n  const compatData = require('core-js-compat').data\n  return includes.filter(item => {\n    if (!compatData[item]) {\n      throw new Error(`Cannot find polyfill ${item}, please refer to 'core-js-compat' for a complete list of available modules`)\n    }\n\n    return isRequired(item, targets, { compatData })\n  })\n}\n\nmodule.exports = (context, options = {}) => {\n  const presets = []\n  const plugins = []\n  const defaultEntryFiles = JSON.parse(process.env.VUE_CLI_ENTRY_FILES || '[]')\n\n  // Though in the vue-cli repo, we only use the two environment variables\n  // for tests, users may have relied on them for some features,\n  // dropping them may break some projects.\n  // So in the following blocks we don't directly test the `NODE_ENV`.\n  // Rather, we turn it into the two commonly used feature flags.\n  if (!process.env.VUE_CLI_TEST && process.env.NODE_ENV === 'test') {\n    // Both Jest & Mocha set NODE_ENV to 'test'.","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/vuejs/vue-cli/blob/7eb93c169c7520935252e2473387f923ef80d856/packages/@vue/babel-preset-app/index.js#L72-L108","documentation":"babel-preset-app's getPolyfills() filters the requested polyfill list against core-js-compat's compat data so it can decide, per browser target, whether each polyfill is actually needed. Every name in the `includes` list (from the preset's `polyfills`/`useBuiltIns` includes or the default list) must be a known key of `require('core-js-compat').data`. When a name is absent, the preset cannot compute its target requirements, so it throws rather than silently dropping or always including it.","triggerScenarios":"Passing a polyfill name to the babel preset that is not a key in core-js-compat.data. Concretely: a core-js 2-style path (`es6.promise`, `core-js/modules/es6.promise`), a typo (`es.promise.finall`), or a name valid only in a newer core-js-compat than the one installed.","commonSituations":"Upgrading or downgrading core-js / @vue/babel-preset-app across major versions; hand-editing the `polyfills` option in babel config; a stale lockfile resolving an older core-js-compat that lacks newer module names.","solutions":["Print valid names with `console.log(Object.keys(require('core-js-compat').data))` and correct/replace the offending entry.","Use core-js 3 module-path naming (e.g. `es.promise`, `es.array.iterator`), not core-js 2 `es6.*` names.","Update core-js-compat to a version consistent with your core-js major: `npm i -D core-js-compat`.","Remove the custom polyfill entry if it is not actually needed."],"exampleFix":"// before\nmodule.exports = {\n  presets: [['@vue/babel-preset-app', { polyfills: ['es6.promise', 'es.promise.finally'] }]]\n}\n// after\nmodule.exports = {\n  presets: [['@vue/babel-preset-app', { polyfills: ['es.promise', 'es.promise.finally'] }]]\n}","handlingStrategy":"validation","validationCode":"const compatData = require('core-js-compat').data\nconst requested = ['es.promise', 'es6.promise'] // your polyfills list\nconst unknown = requested.filter(name => !compatData[name])\nif (unknown.length) {\n  throw new Error(`Unknown polyfill names (not in core-js-compat): ${unknown.join(', ')}`)\n}","typeGuard":"const isKnownPolyfill = (name) => Object.prototype.hasOwnProperty.call(require('core-js-compat').data, name)","tryCatchPattern":null,"preventionTips":["Always source polyfill names from `Object.keys(require('core-js-compat').data)`.","Keep core-js, core-js-compat, and @vue/babel-preset-app on the same major.","Avoid core-js 2 `es6.*` naming in modern configs."],"tags":["babel","polyfill","core-js","configuration"],"backgroundTag":null,"analyzedSha":"7eb93c169c7520935252e2473387f923ef80d856","analyzedAt":"2026-08-13T10:13:37.803Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}