# Fix the Browserslist caniuse-lite Is Outdated Warning

Yes. An agent runs update-browserslist-db in its sandbox, shows whether the new data changes any build target, rebuilds without the warning and opens a PR.

[Run this on Rush](https://cloud.getrush.ai/run/fix-caniuse-lite-is-outdated-warning/browserslist/). Opens 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 finds where Browserslist is read. In a library like jeffbski/redux-logic, `.browserslistrc` says `last 1 version`, `not dead`, `> 0.2%` and `maintained node versions`; `babel.config.js` feeds that to `@babel/env` with `useBuiltIns: 'usage'` and `corejs: '3.33.2'`, and turns on preset `debug` when `CI` is `true` so the build prints its targets. `package.json` lists `browserslist` at `^4.24.4` in `devDependencies`, has a `browserslist` script that prints the resolved targets, and builds with `babel src --out-dir build-lib` for CommonJS, again for ES modules, and `webpack` for the UMD bundle. The lock file (`lockfileVersion` 2) resolves `browserslist` to 4.24.4, `caniuse-lite` to 1.0.30001692 and `update-browserslist-db` to 1.1.2. There is no workflow under `.github`; the README still carries a Travis badge.

It installs from the lock file (`npm ci`, 758 packages) and runs the build as it is. `npm run build:commonjs` prints `Browserslist: browsers data (caniuse-lite) is 23 months old. Please run: npx update-browserslist-db@latest` with the link to the update-db README, then `Successfully compiled 10 files with Babel`. `npx browserslist` prints the same warning before its list. So the build works; the data Babel uses to decide which syntax to transform and which core-js polyfills to inject is what is stale, and it is pinned by the lock file, not by `package.json`.

The fix is the command the warning names, run where the lock file is. `npx update-browserslist-db@latest` removes the old `caniuse-lite` entry from the lock file, installs the current one, cleans the temporary entries it added to `package.json`, and ends with `caniuse-lite has been successfully updated` and `No target browser changes`. The diff is `package-lock.json` only, 9 lines in and 8 out, moving `caniuse-lite` from 1.0.30001692 to 1.0.30001823. The agent rebuilds and the warning is gone, and runs `npm test` to show the 660 Mocha tests still pass on the output of the updated preset.

It also records what the update means for the output, because a newer browser list can change what `@babel/env` emits. It diffs the `npx browserslist` output before and after and quotes the tool's own "No target browser changes" line, and since `build-lib` is not committed it compares a build from before and after the update and reports whether any file differs. That comparison is what makes the pull request reviewable in one minute: a lock file diff plus proof that the compiled output did or did not move.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "The build in this repository prints \"Browserslist: caniuse-lite is outdated\" (or \"browsers data (caniuse-lite) is N months old\"). Read the Browserslist configuration (.browserslistrc or the browserslist key in package.json), the Babel or bundler config that consumes it, package.json and the lock file first. Install from the lock file and run the build to quote the warning. Then run npx update-browserslist-db@latest, show the lock file diff and the caniuse-lite version before and after, rebuild to confirm the warning is gone, and run the tests. Compare the resolved target list and the compiled output before and after the update and state whether anything changed. Commit only the lock file change and open a pull request that quotes the warning, the update command's output and the comparison.",
  "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 whose diff is `package-lock.json` alone, with `caniuse-lite` moved to the current release and nothing added to `package.json`. The description quotes the `23 months old` warning from the first build, the update command's output ending in `caniuse-lite has been successfully updated` and `No target browser changes`, the clean rebuild, and the Mocha summary of 660 passing tests.

It also states, from a before and after comparison of the resolved targets and the compiled `build-lib` files, whether the new data changed any emitted file. A reviewer reads one number in the lock file and that one sentence, and merges; the run's record holds the two builds for anyone who wants to see the diff themselves.

## Run it on every Monday morning

This is the dependency that goes stale on its own: nothing in `package.json` changes, only the lock file ages. An automation in the Project that holds the repository, with a `schedule` trigger, a `cron` of `0 7 * * 1` and the team's `timezone`, runs this prompt each Monday, and most weeks it ends with nothing to commit; when the data is old enough to warn, it opens the one-line pull request. A run an automation starts has its own `max_runs_per_hour` cap and is not tied to an API key.

From your own scheduler instead, send this body to `POST /o/{org}/sessions` with a `request_id` that is a UUID v5 of the week's date, so a retried job returns the run it already started. The key's `webhook_url` receives `run.completed` or `run.failed` with the session URL when the run ends.

## Why run it on Rush?

The command itself is trivial; what a reviewer wants to know is whether the new browser data changed the compiled output, and answering that means two full builds from a clean install and a diff between them. The agent does that in its own sandbox and keeps both builds and the target lists in the run's record, so the pull request says what moved rather than assuming a lock file bump is harmless.

It is also a warning everyone has learned to scroll past, which is why it stays in the build log for 23 months. Running the check on a schedule, in a sandbox that installs from the lock file exactly as CI does, turns it into a pull request that appears only when there is something to merge, and the same automation fits every Project whose repository has a lock file.

## Frequently asked questions

### Why is the data outdated when I install fresh every time?

Because `caniuse-lite` is pinned by the lock file, and `npm ci` installs exactly that version. The package is updated far more often than most projects touch their lock file, and Browserslist warns once the installed data is old enough. Only a lock file change moves it, which is what `update-browserslist-db` does.

### Does updating the data change my build output?

It can. Browserslist resolves queries like `last 1 version` against the data, so newer data can add or drop a target, and `@babel/env` decides what to transform and which polyfills to inject from that list. The agent compares the resolved targets and the compiled files before and after the update and says in the pull request whether anything changed; here the tool reports no target browser changes.

### Can I just silence the warning?

The warning has no off switch in Browserslist, and silencing it would keep the stale data. The fix is to update the data, which takes one command and changes one lock file entry. A scheduled run keeps it from coming back.

### What about pnpm or Yarn?

`update-browserslist-db` detects the lock file in the repository and runs the matching package manager's install and uninstall. The agent runs the same command and the diff lands in `pnpm-lock.yaml` or `yarn.lock` instead; the rest of the check is identical.

## More jobs like this: Upgrade dependencies weekly

- [Fix Cannot Find Module @babel/core After a babel-loader Upgrade](https://getrush.ai/run/fix-cannot-find-module-babel-core/babel-loader/)
- [Fix "Cannot Import Name 'Imputer' from 'sklearn.preprocessing'" After a scikit-learn Upgrade](https://getrush.ai/run/fix-cannot-import-name-imputer-from-sklearn-preprocessing/scikit-learn/)
- [Fix d3.event Is Undefined After Upgrading D3](https://getrush.ai/run/fix-d3-event-removed/d3/)
- [Fix "Support for defaultProps Will Be Removed from Function Components" After a React 18.3 Upgrade](https://getrush.ai/run/fix-defaultprops-will-be-removed-from-function-components-warning/react/)
- [Fix the delim_whitespace Keyword in pd.read_csv Is Deprecated Warning](https://getrush.ai/run/fix-delim-whitespace-keyword-is-deprecated-warning/pandas/)
- [Fix "AttributeError: 'Engine' object has no attribute 'execute'" in SQLAlchemy 2.0](https://getrush.ai/run/fix-engine-object-has-no-attribute-execute/sqlalchemy/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
