Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

node 22LTS and punycode #598

Open
pelikhan opened this issue Nov 8, 2024 · 5 comments
Open

node 22LTS and punycode #598

pelikhan opened this issue Nov 8, 2024 · 5 comments

Comments

@pelikhan
Copy link

pelikhan commented Nov 8, 2024

It seems that the SDK has a dep on a deprecated API in node 22LTS. This is the error message I get

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

which after turning tracing looks like it's coming from whatwg-url

@pelikhan ➜ /workspaces/genaiscript (dedup) $ node --trace-deprecation packages/cli/built/genaiscript.cjs run poem
(node:17473) [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:399:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10)
    at loadBuiltinModule (node:internal/modules/helpers:114:7)
    at Function._load (node:internal/modules/cjs/loader:1100:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1340:12)
    at require (node:internal/modules/helpers:141:16)
    at ../../node_modules/whatwg-url/lib/url-state-machine.js (/workspaces/genaiscript/packages/cli/built/genaiscript.cjs:14681:20)

which seems to be coming from the SDK

@pelikhan ➜ /workspaces/genaiscript (dedup) $ npm ls whatwg-url└─┬ genaiscript-core-internal@1.72.0 -> ./packages/core
  └─┬ @anthropic-ai/sdk@0.30.1
    └─┬ node-fetch@2.7.0
      └── whatwg-url@5.0.0

I might be wrong.

@RobertCraigie RobertCraigie changed the title node 22LTS and punnycode node 22LTS and punycode Nov 18, 2024
@jacksondc
Copy link

I'm affected by this too

@jeswin
Copy link

jeswin commented Dec 29, 2024

Temporarily solving it with process.noDeprecation = true;

It's a big problem for CLI tools, which every command print this warning. Users will start seeing this when they upgrade to node 22.

@RobertCraigie
Copy link
Collaborator

This is fixed in our latest alpha release, please give it a try! #645

@pelikhan
Copy link
Author

Could you bump the node-fetch version in the stable release?

@RobertCraigie
Copy link
Collaborator

RobertCraigie commented Jan 29, 2025

@pelikhan unfortunately we cannot, the current version of the SDK requires an older version of node-fetch as later versions have dropped support for CJS. The alpha version should be promoted to stable ~soon.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants