All jobs

Fix the babel-preset-react-app private-property-in-object Warning

Yes. An agent reproduces the warning with a clean build in its sandbox, adds the one Babel plugin the message asks for as a devDependency and opens a PR.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

The agent clones the repository into its own cloud sandbox and reads the build setup. In a Create React App project like 0xreviews/crvusd-rate-chart, package.json has react-scripts at 5.0.1 with react and react-dom at ^18.2.0, chart.js at ^4.3.0, ethers at ^5.7.2 and plotly.js-dist-min at ^2.24.0, the four CRA scripts, an eslintConfig extending react-app, and a browserslist block. The lock file (lockfileVersion 3) resolves babel-preset-react-app to 10.0.1 and @babel/plugin-proposal-private-property-in-object to 7.21.10, pulled in by that preset. The README's whole setup is npm install and npm run start. There is no workflow under .github.

It installs from the lock file with npm ci and runs npm run build. The output begins with Browserslist's own outdated-data notice, then the paragraph the title is about: One of your dependencies, babel-preset-react-app, is importing the "@babel/plugin-proposal-private-property-in-object" package without declaring it in its dependencies. This is currently working because "@babel/plugin-proposal-private-property-in-object" is already in your node_modules folder for unrelated reasons, but it may break at any time. It goes on to say that babel-preset-react-app is part of Create React App, which is no longer maintained, and ends with the fix: Add "@babel/plugin-proposal-private-property-in-object" to your devDependencies to work around this error. The build then reports Compiled with warnings. with a list of no-unused-vars, react-hooks/exhaustive-deps and jsx-a11y/alt-text findings from ESLint, and the build folder is written.

The agent reads where the text comes from before acting on it. It is not printed by CRA: node_modules/@babel/plugin-proposal-private-property-in-object/lib/index.js requires babel-preset-react-app/package.json, stays quiet if the plugin is listed in that preset's dependencies, otherwise walks up the directory tree reading each package.json and stays quiet if any lists the plugin under dependencies or devDependencies, and only then schedules console.warn on a 2500 ms timer. So the project's own package.json is the switch, which is exactly what the message says.

The fix is the one the message asks for: npm install --save-dev @babel/plugin-proposal-private-property-in-object, which adds "@babel/plugin-proposal-private-property-in-object": "^7.21.11" to devDependencies and changes 11 lines of the lock file. The agent rebuilds: no warning paragraph, Compiled with warnings. with the same ESLint list, exit 0. It leaves the ESLint findings and the Browserslist notice alone and names both in the pull request as separate work, since CI=true turns those ESLint warnings into a failed build and that is a decision for the team.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "The build of this Create React App project prints \"One of your dependencies, babel-preset-react-app, is importing the @babel/plugin-proposal-private-property-in-object package without declaring it in its dependencies\". Read package.json, the lock file and any CI workflow first, install from the lock file and run the production build to quote the warning in full. Find the code that prints it under node_modules and state the condition it checks. Then add @babel/plugin-proposal-private-property-in-object to devDependencies with the package manager the lock file belongs to, rebuild, and confirm the paragraph is gone. Change nothing else: if the build also prints ESLint warnings or a Browserslist notice, leave them and list them in the pull request as separate items. Open a pull request with the before and after build output.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

What comes back is a pull request that adds one devDependencies entry to package.json and the matching lines to the lock file, and touches no source file. The description quotes the warning paragraph from the first build, names the file under node_modules that prints it and the package.json check it performs, and pastes the second build's output with the paragraph absent and the same Compiled with warnings. summary.

It also lists what it left alone: the ESLint findings by file and rule, and the Browserslist notice with the command that clears it. A reviewer checks that the added version matches the one the lock file already resolves, confirms the diff is two files, and merges; the run's record holds both builds.

Run it on every terminal hand-off

You see the paragraph in the middle of a build and do not want to stop for it. In the console, open the Project that has the repository, paste this prompt into the composer and start it; or send this body to POST /o/{org}/sessions with curl from your terminal, with a request_id that is a UUID v5 of the branch name so a repeated command returns the run already started, and follow it on GET /o/{org}/sessions/{id}/events.

The key's webhook_url receives run.completed or run.failed with the session URL when the run ends, and the pull request link is on the session.

The use case this job follows, with its automation and trigger: Hand off a long task.

Why run it on Rush?

The warning tells you what to do, and the value of the agent is in doing it carefully: a clean install from the lock file, a production build to quote the exact text, a look at the code that prints it so the pull request explains why one devDependencies line is the whole fix, and a second build to prove it. All of that runs in the agent's own sandbox and stays in the run's record.

It is also a message from a build tool that is no longer maintained, in a project that still has to ship. Handing it off from the terminal gets a two-file pull request back with the build logs attached, and leaves the larger question the message raises, whether to move off Create React App, as a note in the description rather than a detour in the middle of someone's afternoon.

Frequently asked questions

Why does my project need to declare a plugin it does not use directly?

Because babel-preset-react-app 10.0.1 requires the plugin without listing it in its own dependencies, and the plugin package warns when nothing in the tree declares it. Adding it to your devDependencies is the documented workaround; the plugin's own code checks your package.json and stays quiet once the name is there.

Will the build output change?

No. The plugin was already installed and already running as part of the preset; the dependency line only declares it. The agent's second build produces the same Compiled with warnings. summary with the same files, which the pull request shows.

The warning says Create React App is not maintained. Should I migrate instead?

That is a separate decision and the agent does not make it. The pull request fixes the warning in two files and notes the message's suggestion in its description. A migration to Vite is its own run with its own prompt, and this change does not get in its way.

Why did the build sometimes fail with "process exited too early"?

Create React App prints that when its build process ends before it expects, and the agent reports any such run in the pull request with the exact line rather than hiding it. It is unrelated to the plugin warning: the fix is checked on a build that completes, with the build folder written.

More Create React App jobs

More jobs like this: Hand off a long task

Keep reading