Skip to content

url: suppress warnings from url.format/url.resolve inside node_modules#62005

Open
Renegade334 wants to merge 1 commit intonodejs:mainfrom
Renegade334:url-resolve-stack-frames
Open

url: suppress warnings from url.format/url.resolve inside node_modules#62005
Renegade334 wants to merge 1 commit intonodejs:mainfrom
Renegade334:url-resolve-stack-frames

Conversation

@Renegade334
Copy link
Member

Fixes: #61724

@Renegade334 Renegade334 added url Issues and PRs related to the legacy built-in url module. deprecations Issues and PRs related to deprecations. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. lts-watch-v24.x PRs that may need to be released in v24.x labels Feb 26, 2026
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/url

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Feb 26, 2026
Comment on lines +16 to +23
// No warnings from inside node_modules
common.spawnPromisified(process.execPath, [fixturePath]).then(
common.mustCall(({ code, signal, stderr }) => {
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);
assert.doesNotMatch(stderr, /\[DEP0169\]/);
})
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test result in affected versions:

AssertionError [ERR_ASSERTION]: The input was expected to not match the regular expression /\[DEP0169\]/. Input:

'(node:2065574) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.\n' +
  '(Use `node --trace-deprecation ...` to show where the warning was created)\n'

    at /tmp/node/test/parallel/test-url-parse-deprecation.js:21:12
    at /tmp/node/test/common/index.js:507:15
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: '(node:2065574) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.\n' +
    '(Use `node --trace-deprecation ...` to show where the warning was created)\n',
  expected: /\[DEP0169\]/,
  operator: 'doesNotMatch',
  diff: 'simple'
}

Node.js v24.14.0

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.72%. Comparing base (abddfc9) to head (00fe10d).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62005      +/-   ##
==========================================
- Coverage   89.72%   89.72%   -0.01%     
==========================================
  Files         676      676              
  Lines      205988   205988              
  Branches    39490    39488       -2     
==========================================
- Hits       184830   184813      -17     
- Misses      13295    13303       +8     
- Partials     7863     7872       +9     
Files with missing lines Coverage Δ
lib/url.js 100.00% <100.00%> (ø)

... and 28 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

});

// Warning should only happen once per process.
common.expectWarning({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this expectation removed for direct url.parse() calls?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't, it's just moved into the consolidated deprecation test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecations Issues and PRs related to deprecations. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. lts-watch-v24.x PRs that may need to be released in v24.x needs-ci PRs that need a full CI run. url Issues and PRs related to the legacy built-in url module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DEP0169 DeprecationWarning: url.parse() when url.resolve() used (node_modules context)

3 participants