ravendb-nodejs-client icon indicating copy to clipboard operation
ravendb-nodejs-client copied to clipboard

Dependency on deprecated punycode module

Open jetzezoethout opened this issue 1 year ago • 4 comments

Running a project using ravendb on the newest version of node (v21) yields a deprecation warning.

Minimal example

package.json

{
  "dependencies": {
    "ravendb": "5.4.1"
  },
  "scripts": {
    "start": "node main.js"
  }
}

main.js

const { DocumentStore } = require("ravendb");

const store = new DocumentStore(/* Your DB connection info */).initialize();

After running npm i, we get the following behaviour:

$ npm run start

> start
> node main.js

(node:78223) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

On older versions of node, the same warning can be seen by adding the --pending-deprecations flag.

The dependency on punycode seems to enter through node-fetch v2. Simply updating to v3 might do the trick.

Specific version information

  • OS: Ubuntu 22.04
  • Node: 21.0.0
  • npm: 10.2.0

jetzezoethout avatar Oct 31 '23 13:10 jetzezoethout

punycode is transtive dependency of eslint. Even when using latest version of eslint (8.52.0). Please also notice that eslint is dev dependency.

If you want to you can similar issue to eslint library.

[email protected] C:\workspaces\client-node\v5.4
`-- [email protected]
  `-- [email protected]
    `-- [email protected]
      `-- [email protected]

In node-fetch I don't see dependency to punycode (https://github.com/node-fetch/node-fetch/blob/main/package.json)

ml054 avatar Oct 31 '23 13:10 ml054

Thanks for your quick reply! I'm aware that punycode is a transitive dependency of eslint, but dev dependencies shouldn't cause runtime warnings in node. I did a bit more digging: running node with the --trace-deprecations flag shows that punycode is used in whatwg-url, which enters through node-fetch:

$ npm list whatwg-url
Test@ ~/Documents/Test
└─┬ [email protected]
  └─┬ [email protected]
    └── [email protected]

jetzezoethout avatar Oct 31 '23 13:10 jetzezoethout

ok we will investigate that with node 21. Thanks :)

ml054 avatar Oct 31 '23 14:10 ml054

For the eslint dependency: https://github.com/garycourt/uri-js/pull/95

domdomegg avatar Jan 14 '24 11:01 domdomegg