statsig-io / node-js-server-sdk

Statsig's SDK for server-side Node.js applications.
ISC License
21 stars 14 forks source link

Deprecated package warning #48

Open seripap opened 1 month ago

seripap commented 1 month ago

While integrating statsig-node, I am receiving some deprecation warnings using node v22.4;

(node:13621) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:3:9
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:398:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:337:10)
    at loadBuiltinModule (node:internal/modules/helpers:96:7)
    at Module._load (node:internal/modules/cjs/loader:1070:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
    at Module.require (node:internal/modules/cjs/loader:1304:12)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (/Users/dseripap/local/workspace/app/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js:2:18)

Tracing the package leads here;

├─┬ statsig-node@5.23.1
│ ├── ip3country@5.0.0
│ ├─┬ node-fetch@2.7.0
│ │ ├── encoding@0.1.13 deduped
│ │ └─┬ whatwg-url@5.0.0
│ │   ├── tr46@0.0.3
│ │   └── webidl-conversions@3.0.1
│ ├── ua-parser-js@1.0.37 deduped
│ └── uuid@8.3.2

A suggestion is to perhaps update node-fetch to the latest version and maybe that'll fix it.

tore-statsig commented 1 month ago

Thanks for the report, we'll take a look!

sroyal-statsig commented 1 month ago

@seripap the punycode dependency is coming from eslint and jest-environment-jsdom which are both dev dependencies. From what I can tell neither of them has a new version that fixes the issue yet but it seems like something they are looking to do in the near future so we can update them once those are available. ├─┬ eslint@8.57.0 │ └─┬ ajv@6.12.6 │ └─┬ uri-js@4.4.1 │ └── punycode@2.3.1 └─┬ jest-environment-jsdom@29.7.0 └─┬ jsdom@20.0.3 ├─┬ tough-cookie@4.1.3 │ └── punycode@2.3.1 deduped └─┬ whatwg-url@11.0.0 └─┬ tr46@3.0.0 └── punycode@2.3.1 deduped