Dependabot Ran, Now What? Fixing Breaking Changes
Dependabot bumps Express 4 to 5 and your app breaks. AWS Transform builds a fix on the fly, repairs every breaking pattern, and validates it.
Dependabot bumps your Express version from 4 to 5. Your app won't load. ATX creates a custom transformation on the fly, fixes every breaking pattern, and validates with 21 tests. All in one session.
The Gap Between "Version Bumped" and "Code Fixed"
Dependabot is excellent at one thing: opening PRs that change version numbers. But that's where its job ends. It doesn't tell you which lines of code break, what the migration path looks like, or whether your tests still pass after the upgrade.
For patch and minor bumps, this is fine. The code usually just works. For major version bumps with breaking changes, the version number is updated but the code is broken. You merge the PR, CI fails, and now someone needs to investigate which patterns changed, grep the codebase, apply the fixes, and validate.
Express 4 to 5 is a textbook example. Express 5 removes several APIs that Express 4 deprecated but still supported. If your codebase uses any of them, upgrading the package version alone breaks your app at import time.
AWS Transform Custom picks up where Dependabot leaves off. It reads the breaking changes, identifies every affected line in your codebase, applies the fixes, and validates that the app loads and runs correctly.
What Breaks in Express 5
Express 5 (released late 2024, now at 5.2.1) removes patterns that Express 4 deprecated over the past several years:
Pattern | Express 4 | Express 5 |
|---|---|---|
res.send(status, body) | Deprecated (emits warning) | Removed completely |
req.param('name') | Deprecated | Removed |
req.host | Returns host with port | Returns hostname only (behavior change) |
body-parser package | Required as separate middleware | Built into Express ( express.json() ) |
app.del() | Deprecated alias | Removed (use app.delete() ) |
res.json(body, status) | Deprecated argument order | Removed |
If your app uses any of these, it fails to start after the Express 5 upgrade. The more patterns you use, the more files break.
The Starting Point
A typical Express 4 API with all the deprecated patterns in active use:
const express = require('express');const bodyParser = require('body-parser');
const app = express();app.use(bodyParser.json());app.use(bodyParser.urlencoded({ extended: true }));
app.get('/info', (req, res) => { res.json({ host: req.host }); // req.host behavior changes in Express 5});
app.get('/items/:id', (req, res) => { const id = parseInt(req.param('id')); // req.param() removed in Express 5 const item = items.get(id); if (!item) { res.send(404, { error: 'Item not found' }); // res.send(status, body) removed return; } res.send(200, item);});Six endpoints, four deprecated patterns. This app works on Express 4 (with deprecation warnings), but crashes on Express 5.
The Transformation Flow

What Changes Between Express 4 and 5
Express 5 was first released in late 2024 after years of development, and the latest stable version is 5.2.x. It represents the first major version bump since Express 4 landed in 2014, which means a decade of accumulated deprecation warnings are now enforced as hard errors.
Key Breaking Changes in Detail
Stricter path matching. Express 5 uses a new version of the
path-to-regexp library with tighter rules. Patterns that relied on implicit wildcards or loose regex matching in Express 4 may not match in Express 5. For example, unescaped special characters in route strings ( ? , + , * ) now require explicit parameter syntax or RegExp usage. Routes like /users/:id? still work, but patterns like /files/* must become /files/:path(*) or use named wildcards.Removed deprecated APIs. Express 4 printed deprecation warnings for APIs like
res.send(status, body) , req.param('name') , and app.del() but continued to function. Express 5 removes them entirely. Code that calls these methods throws at runtime rather than logging a warning.Async error handling. Express 5 automatically catches rejected promises and errors thrown in
async route handlers and forwards them to the error middleware. In Express 4, an unhandled promise rejection in an async handler would hang the request or crash the process unless the developer explicitly wrapped everything in try/catch. This is a positive change, but it can surface latent bugs in existing code if error middleware wasn't designed to handle async rejections.Built-in body parsing. Express 5 ships
express.json() and express.urlencoded() as built-in middleware (carried over from 4.16+, but now the canonical approach). The standalone body-parser package is no longer needed. Code that still imports body-parser continues to work, but it adds an unnecessary dependency.Why Teams Delay the Upgrade
Express 4 deprecation warnings are non-fatal. They appear in server logs, but the application continues to handle requests normally. Teams learn to ignore them because nothing actually breaks. The upgrade gets deferred quarter after quarter until an external pressure forces action: a Node.js version reaching end-of-life, a security CVE in Express 4 that won't be backported, or an internal audit flagging outdated major versions.
This deferral pattern is rational in the short term but compounds over time. Each new endpoint that uses a deprecated pattern adds migration scope.
The Cost of Delay
The longer teams wait, the more deprecated patterns accumulate in the codebase. Deprecation warnings pollute server logs, making it harder to spot real issues. New developers learn patterns from existing code without realizing they're deprecated. The team misses access to Express 5 features: improved async error propagation, better performance from the modernized router internals, and a smaller dependency surface (no need for
body-parser ). Eventually the migration becomes a project rather than a quick fix, which further reduces the motivation to start.ATX eliminates this cost by handling the migration in a single session, regardless of how many deprecated patterns have accumulated.
Running the Transformation
cd express-appgit init && git add . && git commit -m "initial: Express 4 app with deprecated patterns"
aws configure # configure AWS credentials (or use env vars / a profile)atxI describe the situation:
> Dependabot has bumped Express from 4.x to 5.x in this project. Fix all breaking changes so the app works with Express 5. Specific patterns to fix: 1) res.send(status, body) must become res.status(s).json(body) 2) req.param('name') must become req.params.name 3) req.host behavior changed, use req.hostname instead 4) Remove body-parser dependency, use express.json() built-in Update package.json to use express ^5.0.0 and remove body-parser. Validation command: node -e "require('./src/app')"ATX searches the registry. No Express 4-to-5 migration TD exists, so it creates one from scratch. The TD covers:
- Dependency updates (express ^5.0.0, remove body-parser)
-
res.send(status, body)tores.status(s).json(body)orres.status(s).send(body)
-
req.param('x')toreq.params.x
-
req.hosttoreq.hostname
-
bodyParser.json()toexpress.json()
- Additional Express 5 patterns (app.del, res.json argument order, regex routes)
ATX saves the TD as a draft and applies it to the codebase.
What ATX Fixed
Every deprecated pattern converted to the Express 5 equivalent:
Before (Express 4) | After (Express 5) |
|---|---|
const bodyParser = require('body-parser') | Removed |
app.use(bodyParser.json()) | app.use(express.json()) |
app.use(bodyParser.urlencoded(...)) | app.use(express.urlencoded(...)) |
res.send(200, allItems) | res.status(200).json(allItems) |
res.send(404, { error: '...' }) | res.status(404).json({ error: '...' }) |
res.send(201, item) | res.status(201).json(item) |
req.param('id') | req.params.id |
req.param('query') | req.params.query |
req.host | req.hostname |
"express": "^4.18.0" | "express": "^5.0.0" |
"body-parser": "^1.20.0" | Removed from dependencies |
The transformed app:
const express = require('express');const app = express();
app.use(express.json());app.use(express.urlencoded({ extended: true }));
app.get('/info', (req, res) => { res.json({ host: req.hostname, timestamp: Date.now(), itemCount: items.size });});
app.get('/items/:id', (req, res) => { const id = parseInt(req.params.id); const item = items.get(id); if (!item) { res.status(404).json({ error: 'Item not found' }); return; } res.status(200).json(item);});Clean, modern Express 5 patterns. No deprecated APIs.
Validation: 21 Tests, All Passing
ATX didn't just fix the code and call it done. It ran comprehensive validation across four categories:
Functional Tests (10/10)
Test | Status |
|---|---|
GET /info (basic route) | PASS |
POST /items (JSON body parsing with express.json()) | PASS |
GET /items (list) | PASS |
GET /items/:id (route params) | PASS |
POST /items missing name (400 error handling) | PASS |
GET /items/999 (404 handling) | PASS |
DELETE /items/:id | PASS |
GET /nonexistent (default 404) | PASS |
GET /search/:query (parameterized search) | PASS |
POST /items (URL-encoded body with express.urlencoded()) | PASS |
Express 5 Breaking Change Audit (6/6)
Check | Status |
|---|---|
No app.del() usage | PASS |
No app.param(fn) with old signature | PASS |
No regex in route paths (stricter in Express 5) | PASS |
No res.json(body, status) deprecated order | PASS |
No res.jsonp() issues | PASS |
No req.query mutation | PASS |
Compatibility Checks (3/3)
Check | Status |
|---|---|
Node.js >= 18 (Express 5 requirement) | PASS (v18.20.2) |
Express 5.2.1 installed correctly | PASS |
No incompatible third-party middleware | PASS |
Regression (2/2)
Check | Status |
|---|---|
Existing test suite passes | PASS (1 suite, 0 failures) |
Middleware ordering correct | PASS |
Total: 21 checks, all passing.
The Dependabot + ATX Workflow
This is how a mature team handles major version bumps:
- Dependabot opens the PR with the version number change
- CI fails (breaking changes in the code)
- Developer runs ATX against the branch to fix the breaking patterns
- ATX validates that the app loads and runs correctly
- Developer reviews the diff and merges
For teams with many services using the same dependency, the workflow scales:
# After Dependabot bumps Express across 20 repos, fix them all:for repo in /path/to/repos/*/; do echo "=== Fixing: $(basename $repo) ===" atx custom def exec \ -n "express-4-to-5-migration" \ -p "$repo" \ -c "node -e \"require('./src/app')\"" \ -x -tdoneNew since this was written: The Dependabot-plus-ATX pattern is now a first-class capability. AWS Transform – continuous modernization wires this directly into CI/CD: it reads Dependabot alerts, runs the remediation transformation, validates, and opens a PR per alert automatically. You can build it yourself (the DIY path, runningatx custom def execinside GitHub Actions) or use the fully managed service withatx ctcommands. See Build your own continuous modernization pipeline with AWS Transform custom .
Publish for Your Team
The TD ATX created is reusable. Publish it so other teams can run the same migration:
atx custom def publish \ --transformation-name "express-4-to-5-migration" \ --description "Migrate Express.js 4.x to 5.x, fixing all breaking API changes" \ --sd .Now anyone on your team can fix their Express 4 apps with one command.
Cost: In one example run this took a few agent minutes at $0.035/agent-minute, on the order of ~$0.10. Agent-minutes are non-deterministic and vary per run and codebase, so treat this as a ballpark and run a pilot to establish your own baseline. Either way it's a fraction of the time spent reading Express 5 migration guides, grepping for deprecated patterns, and testing each fix manually.
Getting Started
# Install ATX (requires Node.js 22+)curl -fsSL https://transform-cli.awsstatic.com/install.sh | bash
# Authenticate (configure AWS credentials)aws configure # or set AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_REGION
# Run against your Express app after Dependabot bumps the versioncd your-express-appatx
# Describe what broke and let ATX fix itOr non-interactively once the TD is published:
atx custom def exec \ --transformation-name "express-4-to-5-migration" \ --code-repository-path . \ --build-command "node -e \"require('./src/app')\"" \ --non-interactive --trust-all-toolsDependabot handles "what needs updating." ATX handles "how to update the code to match." Together they turn a major version bump from a multi-hour investigation into a validated, one-command fix.
Resources
- AWS Transform Custom docs: docs.aws.amazon.com/transform/latest/userguide/custom.html
- Express 5 migration guide: expressjs.com/en/guide/migrating-5.html
- ATX pricing: $0.035/agent-minute
References
[1] Express.js, "Migrating from Express 4 to Express 5." https://expressjs.com/en/guide/migrating-5.html
[2] AWS, "AWS Transform Custom documentation." https://docs.aws.amazon.com/transform/latest/userguide/custom.html
Disclaimer: Opinions expressed are personal and do not represent the official position of any organization. All claims about ATX capabilities are verified against the official documentation .
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article