kiln / flourish-sdk

The SDK for developing Flourish templates
Other
80 stars 16 forks source link

Node 21 throw DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. #91

Closed aendra-rininsland closed 3 months ago

aendra-rininsland commented 7 months ago

In SDK 4.1.1 on Node 21.1.0 I get:

(node:67300) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.

The warning disappears if I downgrade to Node 20.

aendra-rininsland commented 6 months ago

Passing NODE_OPTIONS='--trace-deprecation' results in the following stack trace:

(node:48324) [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:392:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:328:10)
    at loadBuiltinModule (node:internal/modules/helpers:101:7)
    at Module._load (node:internal/modules/cjs/loader:1001:17)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/Users/aendra.rininsland/Projects/flourish-kit/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)

If I then do npm ls whatwg-url it's coming from node-fetch. The latest version is 3.3.2, you're using 2.7.0.

npm ls node-fetch
create-ft-graphics-flourish@ /Users/aendra.rininsland/Projects/flourish-kit
├─┬ @flourish/sdk@4.2.1
│ └── node-fetch@2.7.0

Annoyingly, the bump moves that package to ESM which might break things for you. That said, I've tried overriding the version of whatwg-url used by node-fetch via package.json#overrides but I still get the Punycode deprecation error.