{"id":"ea01b6710cfd6386","repo":"babel/babel","slug":"the-usebuiltins-option-has-been-removed-use-the","errorCode":null,"errorMessage":"The 'useBuiltIns' option has been removed. Use the 'corejs'option to polyfill with `core-js` via @babel/runtime.","messagePattern":"The 'useBuiltIns' option has been removed\\. Use the 'corejs'option to polyfill with `core-js` via @babel/runtime\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/babel-plugin-transform-runtime/src/index.ts","lineNumber":50,"sourceCode":"  }\n\n  if (typeof runtimeVersion !== \"string\") {\n    throw new Error(`The 'version' option must be a version string.`);\n  }\n\n  if (moduleName !== null && typeof moduleName !== \"string\") {\n    throw new Error(\"The 'moduleName' option must be null or a string.\");\n  }\n\n  if (Object.hasOwn(options, \"useBuiltIns\")) {\n    // @ts-expect-error deprecated options\n    if (options.useBuiltIns) {\n      throw new Error(\n        \"The 'useBuiltIns' option has been removed. The @babel/runtime \" +\n          \"module now uses builtins by default.\",\n      );\n    } else {\n      throw new Error(\n        \"The 'useBuiltIns' option has been removed. Use the 'corejs'\" +\n          \"option to polyfill with `core-js` via @babel/runtime.\",\n      );\n    }\n  }\n\n  if (Object.hasOwn(options, \"polyfill\")) {\n    // @ts-expect-error deprecated options\n    if (options.polyfill === false) {\n      throw new Error(\n        \"The 'polyfill' option has been removed. The @babel/runtime \" +\n          \"module now skips polyfilling by default.\",\n      );\n    } else {\n      throw new Error(\n        \"The 'polyfill' option has been removed. Use the 'corejs'\" +\n          \"option to polyfill with `core-js` via @babel/runtime.\",\n      );","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/babel/babel/blob/06b6eae39da4ce0689fad64e2c48a6375a464208/packages/babel-plugin-transform-runtime/src/index.ts#L32-L68","documentation":"Thrown by @babel/plugin-transform-runtime when the deprecated 'useBuiltIns' option key is present AND its value is falsy (false, 0, null, etc.). The message differs from error 236 because a falsy useBuiltIns meant the user wanted to avoid using builtins — which is no longer possible without core-js. The error directs the user to the 'corejs' option for polyfilling. The branch is at line 50.","triggerScenarios":"Having useBuiltIns: false (or any falsy value) in the @babel/plugin-transform-runtime options. Detected via Object.hasOwn at line 42, falsy branch at line 49.","commonSituations":"Babel 7 to 8 migration where useBuiltIns: false was set to force helper-based polyfills; a preset that explicitly set useBuiltIns: false for older environments.","solutions":["Remove the 'useBuiltIns' key and use the 'corejs' option instead if you need core-js polyfills: corejs: { version: 3 }.","If you do not need polyfilling, simply remove the key — Babel 8 skips polyfilling by default."],"exampleFix":"// before\n[\"@babel/plugin-transform-runtime\", { \"useBuiltIns\": false }]\n// after\n[\"@babel/plugin-transform-runtime\", { \"corejs\": { \"version\": 3 } }]","handlingStrategy":"validation","validationCode":"if (Object.hasOwn(config, \"useBuiltIns\") && !config.useBuiltIns) {\n  delete config.useBuiltIns;\n  if (!config.corejs) config.corejs = { version: 3 };\n  console.warn(\"Migrated useBuiltIns:false to corejs:{version:3} for transform-runtime\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["If you relied on useBuiltIns:false for helper-only mode, remove the key — Babel 8 defaults to helpers only.","If you need core-js polyfills, use the corejs option explicitly.","Document the Babel 8 option changes in your team's build config guide."],"tags":["config","runtime","babel-8","breaking-change","deprecated","corejs","babel-plugin"],"analyzedSha":"06b6eae39da4ce0689fad64e2c48a6375a464208","analyzedAt":"2026-08-03T20:13:43.465Z","schemaVersion":2}