Repository navigation
url.parse regression in 18.17+ #49330
Copy link
Copy link
Closed
Labels
duplicateIssues and PRs that are duplicates of other issues or PRs.Issues and PRs that are duplicates of other issues or PRs.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.
Description
Activity
👀 Just noting that this does work with
new url():Welcome to Node.js v18.17.1. Type ".help" for more information. > new url("npm:postman-request@2.88.1-postman.33") URL { href: 'npm:postman-request@2.88.1-postman.33', origin: 'null', protocol: 'npm:', username: '', password: '', host: '', hostname: '', port: '', pathname: 'postman-request@2.88.1-postman.33', search: '', searchParams: URLSearchParams {}, hash: '' }url#parseis a deprecated stability-0 method: https://nodejs.org/dist/latest-v18.x/docs/api/url.html#urlparseurlstring-parsequerystring-slashesdenotehostIf I had to guess, Ada 2.x is the cause of this? It was landed in 18.17.0: #48345
#45514 seems to be another similar issue from the past, though not as niche as this one.
I've opened raineorshine/npm-check-updates#1319 with a library I use that broke due to this when used with npm aliases, so hopefully things will be fixed there. But I do worry if there's other older libraries in the ecosystem that might see impact here too.
- addedduplicateIssues and PRs that are duplicates of other issues or PRs.Issues and PRs that are duplicates of other issues or PRs.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.
on Aug 26, 2023 This issue is fixed with #48873 and will be part of the next Node 18 release.
Reacted by Mert Can Altin and Jonathan YarborReacted by Mert Can Altin
Metadata
Metadata
Assignees
Labels
duplicateIssues and PRs that are duplicates of other issues or PRs.Issues and PRs that are duplicates of other issues or PRs.urlIssues and PRs related to the legacy built-in url module.Issues and PRs related to the legacy built-in url module.
Version
v18.17.1
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
No response
What steps will reproduce the bug?
18.17.1
18.16.0
What do you see instead?
18.17.1 throws a
ERR_INVALID_URLTypeErrorinstead of returning theURLobject as per 18.16.0 and prior.Additional information
This string seems to parse fine using
new url('npm:postman-request@2.88.1-postman.33')in both18.16.0and18.17.1.In 18.17:
PARSES:
npm:postman-request@2.88.1PARSES:
npm:postman-request@2.88.1-postmanPARSES:
npm:postman-request@2.88.1-postman.FAILS:
npm:postman-request@2.88.1-postman.33PARSES:
schema:something@1.0.0PARSES:
schema:something@1.0.0-pFAILS:
schema:something@1.0.0-p.1In 18.16, all parse fine.