langchain punycode deprecated
Checked other resources
- [ ] I added a very descriptive title to this issue.
- [ ] I searched the LangChain.js documentation with the integrated search.
- [ ] I used the GitHub search to find a similar question and didn't find it.
- [ ] I am sure that this is a bug in LangChain.js rather than my code.
- [ ] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
Example Code
langchain punycode deprecated
Error Message and Stack Trace (if applicable)
(node:47096) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
Description
@langchain/mongodb and @langchain/community
(node:47096) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
System Info
node v22.12.0 LTS
Have noticed this too - will dig in and see if I can find the offending package.
Ok, looks like it's deeper in the OpenAI SDK, which community depends on indirectly.
Will push on this existing issue there:
https://github.com/openai/openai-node/issues/1207
Looks like there's some progress on this already!
https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774/3
I and others have documented this extensively for those of us who depend on ESLint ... which is everyone. https://github.com/eslint/eslint/issues/19007#issuecomment-2563191411
(node:72543) [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:110:7)
at Function._load (node:internal/modules/cjs/loader:1095:17)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at Module.require (node:internal/modules/cjs/loader:1335:12)
at require (node:internal/modules/helpers:136:16)
at Object.<anonymous> (node_modules/whatwg-url/lib/url-state-machine.js:2:18)
npm ls whatwg-url
XXXXXXXXXXXXXXXXXXXX
└─┬ @langchain/[email protected]
└─┬ @browserbasehq/[email protected]
└─┬ [email protected]
└── [email protected]
The main problem is that node-fetch <v3 uses old library because is node14 backguard compatibility https://github.com/node-fetch/node-fetch/pull/1793, I used overrides to node-fetch v3.3.2 and the warning disapeared