{"id":19328,"library":"babel-preset-react-app-babel-7","title":"babel-preset-react-app (Babel 7 fork)","description":"babel-preset-react-app-babel-7 v4.0.2-0 is the Babel preset used by Create React App, forked to support Babel 7. This package is a legacy version of the preset bundled with react-scripts v4.x and later. It is not actively maintained separately; users should upgrade to react-scripts@5+ or migrate to @babel/preset-env, @babel/preset-react, and @babel/preset-typescript individually. The preset includes plugins for React JSX transform, object rest spread, and uses useBuiltIns. It is intended for CRA projects but can be used standalone. Release cadence is tied to CRA releases; no independent releases are planned.","status":"deprecated","version":"4.0.2-0","language":"javascript","source_language":"en","source_url":"https://github.com/facebook/create-react-app","tags":["javascript"],"install":[{"cmd":"npm install babel-preset-react-app-babel-7","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-react-app-babel-7","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-react-app-babel-7","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for Babel 7 compatibility","package":"@babel/core","optional":false},{"reason":"runtime helpers used by the preset","package":"@babel/runtime","optional":false},{"reason":"enables macros in React code","package":"babel-plugin-macros","optional":false},{"reason":"polyfills via useBuiltIns; version depends on CRA version","package":"core-js","optional":false}],"imports":[{"note":"Preset name is 'react-app', not the npm package name. Use short name in .babelrc.","wrong":"module.exports = { presets: ['babel-preset-react-app-babel-7'] }","symbol":"react-app","correct":"module.exports = { presets: ['react-app'] }"},{"note":"CommonJS usage. No ESM export available; this package does not ship an ES module.","wrong":"","symbol":"default export","correct":"const preset = require('babel-preset-react-app-babel-7');"},{"note":"Must set flow: false to avoid conflict when using TypeScript.","wrong":"{ presets: ['react-app', '@babel/preset-typescript'] }","symbol":"Flow disable","correct":"{ presets: [['react-app', { flow: false }], '@babel/preset-typescript'] }"},{"note":"absoluteRuntime option may be needed for monorepos; defaults to false.","wrong":"","symbol":"Options for environments","correct":"{ presets: [['react-app', { absoluteRuntime: false }]] }"}],"quickstart":{"code":"npm install --save-dev babel-preset-react-app-babel-7 @babel/core @babel/runtime\necho '{ \"presets\": [\"react-app\"] }' > .babelrc\n# Then compile with Babel\nnpx babel src --out-dir lib","lang":"javascript","description":"Install the preset and core Babel dependencies, configure .babelrc, and compile using Babel CLI."},"warnings":[{"fix":"Upgrade to react-scripts@5+ or replace with @babel/preset-env, @babel/preset-react, @babel/preset-typescript.","message":"babel-preset-react-app-babel-7 is a legacy package; actively use react-scripts or migrate to standalone Babel presets.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Set { runtime: 'automatic' } when using React 17+ or use @babel/preset-react with { runtime: 'automatic' } instead.","message":"This preset does not support the new JSX transform introduced in Babel 7.9+; requires React 16 or earlier runtime.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Add import 'core-js/stable' at the top of your entry file.","message":"Preset uses useBuiltIns: 'entry' by default; you must import core-js in your entry point or polyfills will be incomplete.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Set options: { flow: false } as shown in the TypeScript usage section.","message":"The 'react-app' preset enables flow syntax by default; if using TypeScript, it will cause errors.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Pin react-scripts to v4.x if you must rely on this preset, or migrate to modern presets.","message":"Package name babel-preset-react-app-babel-7 is forked for legacy compatibility; future CRA versions may remove it.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Ensure @babel/runtime is installed as a production dependency.","message":"The preset depends on @babel/runtime for helpers; missing it will cause runtime errors like 'Cannot find module '@babel/runtime/...'.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev babel-preset-react-app-babel-7' and use preset name 'react-app'.","cause":"Missing package installation or misconfigured preset name.","error":"Error: Cannot find module 'babel-preset-react-app-babel-7'"},{"fix":"Ensure @babel/core is version 7.x and babel-preset-react-app-babel-7 is v4.x.","cause":"Using an incompatible version of Babel (Babel 6 vs 7).","error":"Error: Plugin/Preset files are not allowed to export objects, only functions."},{"fix":"Add 'react-app' to presets array in Babel config.","cause":"Preset not applied correctly; missing 'react-app' from .babelrc or Babel config.","error":"Failed to parse: [BABEL] unknown: Support for the experimental syntax 'jsx' isn't currently enabled"},{"fix":"Upgrade to @babel/core 7.x and ensure all Babel plugins are Babel 7 compatible.","cause":"Mismatched Babel versions: project using Babel 6 with this preset.","error":"Error: Requires Babel \"7\", but was loaded with \"6.x\""},{"fix":"Install @babel/runtime as a production dependency: 'npm install @babel/runtime'","cause":"Missing @babel/runtime dependency.","error":"Module not found: Can't resolve '@babel/runtime/helpers/extends'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}