Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Adding an override for whatwg-url to remove Node's DeprecationWarning about punycode #3

Open
RobinCsl opened this issue Nov 9, 2024 · 1 comment

Comments

@RobinCsl
Copy link

RobinCsl commented Nov 9, 2024

Hello Scott,

Just going through the replay of your workshop and cloned the repo, managed to get things running.

With Node.js v22.7.0, I got a warning in the console, which makes the output less nice to read:

$ NODE_OPTIONS="--trace-deprecation" npm start "hello, my name is Smith"

> start
> npx tsx index.ts hello, my name is Smith

(node:227918) [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:99:7)
    at Module._load (node:internal/modules/cjs/loader:1099:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:126:16)
    at Object.<anonymous> (.../agent-from-scratch/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
Hello, Smith! How can I assist you today?

You might want to consider adding this overrides in the package.json file to make the warning go away (after another npm install)

"overrides": {
  "whatwg-url": "13.0.0"
}

Got this solution from openai/openai-node#527 (comment) and it works fine for me.

All the best.

@dtauer
Copy link
Collaborator

dtauer commented Nov 11, 2024

Thank you for posting this! We'll be starting QA work on the course this week and will get the documentation of the course updated along with this fix.

dtauer added a commit that referenced this issue Dec 18, 2024
dtauer added a commit that referenced this issue Dec 18, 2024
More info in #3 

This only applies for users with Node 22+. The `main` and `step/1` branches have been updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants