next.js
next.js copied to clipboard
docs: remove deprecated url.parse() from custom server example
This PR updates the custom server documentation to remove usage of Node's
deprecated url.parse() API. The example does not require URL parsing, since
the parsedUrl argument is optional for the Next.js RequestHandler.
Removing url.parse() avoids Node deprecation warnings (DEP0116, DEP0169) and
keeps the example aligned with current best practices.
What changed?
- Removed the
url.parse()import and usage. - Removed unused
parsedUrlvariable. - Updated both TS and JS examples to use
handle(req, res)directly.
Why?
url.parse()is deprecated in modern Node versions.- The example works without URL parsing.
- Simplifies the docs and matches recommended APIs.
Fixes #86951
Allow CI Workflow Run
- [ ] approve CI run for commit: 47c8bdee374d7d112690b3cde35362d79022e10e
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer
Allow CI Workflow Run
- [ ] approve CI run for commit: 47c8bdee374d7d112690b3cde35362d79022e10e
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer