Skip to content

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

Closed

Description

@MikeMcC399

Version

24.x & 25.x - see #61724 (comment) for details

Platform

Linux ubuntu-24.04 6.17.0-14-generic #14~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jan 15 15:52:10 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

url

What steps will reproduce the bug?

Run example from Legacy URL API url.resolve(from, to)

const url = require('node:url');
url.resolve('/one/two/three', 'four');         // '/one/two/four'
url.resolve('http://example.com/', '/one');    // 'http://example.com/one'
url.resolve('http://example.com/one', '/two'); // 'http://example.com/two'

How often does it reproduce? Is there a required condition?

For the above steps, it always reproduces in Node.js 25.4.0 - 25.6.0. It is a regression from Node.js 25.3.0.

If the url.resolve() call is embedded in an npm package, it depends how the corresponding module is called, whether or not a deprecation warning appears. See the additional information section below for examples.

What is the expected behavior? Why is that the expected behavior?

The example with only url.resolve() should run without producing a deprecation warning.

The history section of url.resolve(from, to) states that the deprecation was revoked in v15.13.0, v14.17.0 and there is no entry for any higher version.

DEP0169 lists url.parse() explicitly. It does not include any direct reference to url.resolve().

What do you see instead?

$ node url-resolve.js
(node:5802) [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.
(Use `node --trace-deprecation ...` to show where the warning was created)

Additional information

I originally noticed this with Cypress, on Ubuntu 24.04.3 LTS, Node.js 25.6.0, with steps to reproduce:

cd $(mktemp -d)
npm install cypress
npx cypress install --force

where the call is from /node_modules/cypress/dist/tasks/download.js.

The following steps however do NOT cause any deprecation warning, even though download is also run:

rm -rf ~/.cache/Cypress
cd $(mktemp -d)
npm install cypress

Activity

  1. MikeMcC399 commented on Feb 11, 2026

    @MikeMcC399
    ContributorAuthor

    ... (b) deepening the node_modules check to avoid the issue. (b) is obviously less disruptive.

    Implementing this would be a quick fix to the regression introduced by #60991 in 24.13.1 and 25.4.0

  2. MikeMcC399 commented on Feb 11, 2026

    @MikeMcC399
    ContributorAuthor

    (a) deprecating url.resolve(...)

    That would solve the issue for usage outside of node_modules in 24.x & 25.x

    Edit: follow-on in #61816

  3. MikeMcC399 commented on Feb 14, 2026

    @MikeMcC399
    ContributorAuthor

    I've moved the deprecation documentation issue to #61816 for clarity. This is about documenting that #55017 added Application deprecation (non-node_modules code only) in v24.0.0 explicitly for url.parse() and the implicit deprecation caused by the dependency of url.resolve() on url.parse() needs to be retroactively added to the documentation for v24.0.0.

  4. MikeMcC399 commented on Feb 14, 2026

    @MikeMcC399
    ContributorAuthor

    With the deprecation documentation issue spun off to #61816, this issue can focus on the regression introduced by #60991 which causes url.resolve() usage in a node_modules environment under Node.js 24.13.1 and 25.4.0 - 25.6.0 to emit DEP0169.

    It seems the change from:

     if (!urlParseWarned && !isInsideNodeModules(100, true)) {

    to

     if (!urlParseWarned && !isInsideNodeModules(2)) {

    was too radical and did not take account of a nested call from urlResolve to urlParse.

    Deprecation detection / suppression needs to be changed so that invoking url.resolve() in a node_modules context does NOT emit DEP0169, the same as is the case for url.parse() in a node_modules context.

  5. changed the title [-]DEP0169 DeprecationWarning: url.parse() when url.resolve() used[/-] [+]DEP0169 DeprecationWarning: url.parse() when url.resolve() used (node_modules context)[/+] on Feb 14, 2026
  6. MikeMcC399 commented on Feb 17, 2026

    @MikeMcC399
    ContributorAuthor

    Also reproducible with the following on Windows using Node.js 24.13.1 installed from MSI package:

    cd $(mktemp -d)
    yarn add yarn
  7. MikeMcC399 commented on Feb 24, 2026

    @MikeMcC399
    ContributorAuthor

    This issue remains reproducible for Node.js 24.14.0 LTS and 25.7.0

    export NODE_OPTIONS='--trace-deprecation'
    cd $(mktemp -d)
    npm install cypress@15.10.0 -D -E --ignore-scripts
    npx cypress cache clear
    npx cypress install

    produces:

    (node:3994) [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.
        at urlParse (node:url:137:13)
        at Object.urlResolve [as resolve] (node:url:721:10)
        at prepend (/tmp/tmp.Bp14h3MLKW/node_modules/cypress/dist/tasks/download.js:65:36)
        at getUrl (/tmp/tmp.Bp14h3MLKW/node_modules/cypress/dist/tasks/download.js:87:12)
        at /tmp/tmp.Bp14h3MLKW/node_modules/cypress/dist/tasks/download.js:283:24
        at Generator.next (<anonymous>)
    

    Edit: Still reproducible in Node.js 24.14.1, no longer reproducible in Node.js >=25.8.1 including 25.9.0

  8. MikeMcC399 commented on Feb 26, 2026

    @MikeMcC399
    ContributorAuthor

    #62002 is submitted to formally confirm deprecation of url.resolve() in a non-node_modules context and to clarify that the definition of DEP0169: Insecure url.parse() as:

    Type: Application (non-`node_modules` code only)
    

    also applies to url.resolve(). In other words, there should be no deprecation warning for node_modules usage of url.resolve()

  9. MikeMcC399 commented on Mar 11, 2026

    @MikeMcC399
    ContributorAuthor

    Verified fixed in Node.js 25.8.1 with test from #61724 (comment) above.

  10. MikeMcC399 commented on Apr 16, 2026

    @MikeMcC399
    ContributorAuthor

    Verified fixed in Node.js 24.15.0 with test from #61724 (comment) above.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    urlIssues and PRs related to the legacy built-in url module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions