You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This update includes major version upgrades for both express and body-parser, introducing significant breaking changes that require code and environment modifications.
Express 4.18.2 → 5.1.0 (High Risk)
This is a long-awaited major release with several fundamental changes. An official migration tool is available to automate many of the required code changes.
Key Breaking Changes:
Node.js Requirement: Express 5 requires Node.js version 18 or higher.
Asynchronous Error Handling: Rejected promises in async route handlers are now automatically caught and passed to the error-handling middleware. This may simplify code by removing the need for try/catch blocks but could conflict with existing error handling logic.
Routing and Path Matching: The path-matching syntax is stricter. Inline regular expressions like app.get('/:id(\d+)') are no longer supported and must be refactored.
Removed Methods: Several deprecated methods have been removed, including app.del() (use app.delete()) and req.param(name) (use req.params, req.body, or req.query directly).
body-parser 1.20.1 → 2.1.0 (High Risk)
This upgrade aligns with the changes in Express 5 and introduces its own breaking changes.
Key Breaking Changes:
Node.js Requirement: Version 2.0.0 and later require Node.js 18 or higher.
req.body Behavior:req.body is no longer initialized to an empty object ({}) if no body is parsed. It will be undefined, which can break code that assumes req.body always exists.
Middleware Removal: The combined bodyParser() middleware has been removed. You must use the specific parsers individually (e.g., bodyParser.json(), bodyParser.urlencoded()).
Recommendation:
Upgrade Node.js: Ensure your deployment environment and CI/CD pipelines are running on Node.js 18 or a newer version.
Run Codemods: Start by running the official Express codemods to automatically fix many of the breaking API changes: npx @expressjs/codemod upgrade.
Review Code: Manually review changes related to routing patterns, async error handling, and any code that assumes req.body is always an object.
Test Thoroughly: These changes affect the core request/response cycle and require extensive testing before deployment.
Notice 🤖: This content was augmented using artificial intelligence. AI-generated content may contain errors and should be reviewed for accuracy before use.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You have signed the CLA already but the status is still pending? Let us recheck it.
Thanks for creating a pull request! A maintainer will review your changes shortly. Please don't be discouraged if it takes a while.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Snyk has created this PR to fix 1 vulnerabilities in the npm dependencies of this project.
Snyk changed the following file(s):
package.jsonVulnerabilities that will be fixed with an upgrade:
SNYK-JS-QS-19432019
Breaking Change Risk
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic
Learn how to fix vulnerabilities with free interactive lessons:
🦉 Uncaught Exception