babel-preset-react-app (Babel 7 fork)

raw JSON →
4.0.2-0 verified Sat Apr 25 auth: no javascript deprecated

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.

error Error: Cannot find module 'babel-preset-react-app-babel-7'
cause Missing package installation or misconfigured preset name.
fix
Run 'npm install --save-dev babel-preset-react-app-babel-7' and use preset name 'react-app'.
error Error: Plugin/Preset files are not allowed to export objects, only functions.
cause Using an incompatible version of Babel (Babel 6 vs 7).
fix
Ensure @babel/core is version 7.x and babel-preset-react-app-babel-7 is v4.x.
error Failed to parse: [BABEL] unknown: Support for the experimental syntax 'jsx' isn't currently enabled
cause Preset not applied correctly; missing 'react-app' from .babelrc or Babel config.
fix
Add 'react-app' to presets array in Babel config.
error Error: Requires Babel "7", but was loaded with "6.x"
cause Mismatched Babel versions: project using Babel 6 with this preset.
fix
Upgrade to @babel/core 7.x and ensure all Babel plugins are Babel 7 compatible.
error Module not found: Can't resolve '@babel/runtime/helpers/extends'
cause Missing @babel/runtime dependency.
fix
Install @babel/runtime as a production dependency: 'npm install @babel/runtime'
deprecated babel-preset-react-app-babel-7 is a legacy package; actively use react-scripts or migrate to standalone Babel presets.
fix Upgrade to react-scripts@5+ or replace with @babel/preset-env, @babel/preset-react, @babel/preset-typescript.
breaking This preset does not support the new JSX transform introduced in Babel 7.9+; requires React 16 or earlier runtime.
fix Set { runtime: 'automatic' } when using React 17+ or use @babel/preset-react with { runtime: 'automatic' } instead.
gotcha Preset uses useBuiltIns: 'entry' by default; you must import core-js in your entry point or polyfills will be incomplete.
fix Add import 'core-js/stable' at the top of your entry file.
gotcha The 'react-app' preset enables flow syntax by default; if using TypeScript, it will cause errors.
fix Set options: { flow: false } as shown in the TypeScript usage section.
deprecated Package name babel-preset-react-app-babel-7 is forked for legacy compatibility; future CRA versions may remove it.
fix Pin react-scripts to v4.x if you must rely on this preset, or migrate to modern presets.
gotcha The preset depends on @babel/runtime for helpers; missing it will cause runtime errors like 'Cannot find module '@babel/runtime/...'.
fix Ensure @babel/runtime is installed as a production dependency.
npm install babel-preset-react-app-babel-7
yarn add babel-preset-react-app-babel-7
pnpm add babel-preset-react-app-babel-7

Install the preset and core Babel dependencies, configure .babelrc, and compile using Babel CLI.

npm install --save-dev babel-preset-react-app-babel-7 @babel/core @babel/runtime
echo '{ "presets": ["react-app"] }' > .babelrc
# Then compile with Babel
npx babel src --out-dir lib