Registry / web-framework / babel-preset-react-app-babel-7

babel-preset-react-app-babel-7

JSON →
library4.0.2-0jsnpmunverified

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.

npm install babel-preset-react-app-babel-7
INSTALL
IMPORT
SIG · BABEL-PRESET-REACT
B
babel-preset-react-app-babel-7
web-frameworkjavascriptv4.0.2-0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

react-app
module.exports = { presets: ['react-app'] }
module.exports = { presets: ['babel-preset-react-app-babel-7'] }
Preset name is 'react-app', not the npm package name. Use short name in .babelrc.
default export
const preset = require('babel-preset-react-app-babel-7');
CommonJS usage. No ESM export available; this package does not ship an ES module.
Flow disable
{ presets: [['react-app', { flow: false }], '@babel/preset-typescript'] }
{ presets: ['react-app', '@babel/preset-typescript'] }
Must set flow: false to avoid conflict when using TypeScript.
Options for environments
{ presets: [['react-app', { absoluteRuntime: false }]] }
absoluteRuntime option may be needed for monorepos; defaults to false.

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
Debug
Known issues
deprecatedbabel-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.
affects: >=4.0.0
breakingThis 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.
affects: >=4.0.0
gotchaPreset 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.
affects: >=4.0.0
gotchaThe '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.
affects: >=4.0.0
deprecatedPackage 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.
affects: >=4.0.0
gotchaThe 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.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-preset-react-app-babel-7'
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: Plugin/Preset files are not allowed to export objects, only functions.
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.
Failed to parse: [BABEL] unknown: Support for the experimental syntax 'jsx' isn't currently enabled
Preset not applied correctly; missing 'react-app' from .babelrc or Babel config.
fix
Add 'react-app' to presets array in Babel config.
Error: Requires Babel "7", but was loaded with "6.x"
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.
Module not found: Can't resolve '@babel/runtime/helpers/extends'
Missing @babel/runtime dependency.
fix
Install @babel/runtime as a production dependency: 'npm install @babel/runtime'
Upgrade
Version history
4.0.2-0latest on npm
Audit
Dependencies
@babel/corerequiredpeer dependency for Babel 7 compatibility
@babel/runtimerequiredruntime helpers used by the preset
babel-plugin-macrosrequiredenables macros in React code
core-jsrequiredpolyfills via useBuiltIns; version depends on CRA version
Agent activity
15 hits · last 30 days
node
10
OpenAI (training)
1
Resources