fix: #83183 Replace deprecated url.parse() with WHATWG URL API#87307
Closed
smuk3c wants to merge 1 commit into
Closed
fix: #83183 Replace deprecated url.parse() with WHATWG URL API#87307smuk3c wants to merge 1 commit into
smuk3c wants to merge 1 commit into
Conversation
Contributor
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
1471bb1 to
d3b9ddb
Compare
Replace Node.js deprecated url.parse() and url.format() with WHATWG URL API to resolve DEP0169 warnings in Node.js 24+. Changes: - Enhanced parseReqUrl() in src/lib/url.ts to match url.parse() behavior - Replaced url.parse() with parseReqUrl() in core server files - Replaced url.format() with formatUrl() from shared utils - Updated test files to use direct WHATWG URL pattern - Added ESLint rule to prevent future usage of deprecated APIs
d3b9ddb to
26a22fa
Compare
|
This PR fixes a production-blocking issue for us; would appreciate it being prioritized when possible. |
mattc0llier
added a commit
to mattc0llier/node24-parse.url-repro
that referenced
this pull request
Jan 13, 2026
This repository provides a minimal reproduction case for the DEP0169 deprecation warning that occurs in Next.js custom servers when running on Node.js 24+. The custom server uses the deprecated url.parse() method which triggers security-related deprecation warnings on every HTTP request. This reproduction helps verify the fix proposed in Next.js PR #87307. Key features: - Custom Next.js server that triggers url.parse() deprecation - Example pages and API routes for testing - Clear documentation on how to reproduce the warning - Runs on Node 24+ with full deprecation trace Related to: vercel/next.js#87307 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Member
|
Appreciate the work. We also started this effort in parallel and landed it in #87257. If there are more instances of |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Fixes #83183
Replace Node.js deprecated
url.parse()andurl.format()with WHATWG URL API to resolve DEP0169 warnings in Node.js 24+.Changes
parseReqUrl()insrc/lib/url.tsto matchurl.parse()behaviorurl.parse()withparseReqUrl()in core server filesurl.format()withformatUrl()from shared utilsWhy WHATWG URL?
url.parse()is deprecated since Node.js 11 (DEP0169)Test Plan
pnpm buildpassespnpm typescriptpassespnpm test-dev test/integration/i18n-support-fallback-rewrite/passespnpm test-dev test/integration/i18n-support-fallback-rewrite-legacy/passes