-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
DeprecationWarning: The 'punycode' module is deprecated in Node.js #15358
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
Comments
I'm unable to repro, running the following script: 'use strict';
const mongoose = require('mongoose');
mongoose.connect('mongodb://127.0.0.1:27017/mongoose_test').then(() => {
console.log('Connected', mongoose.version, process.version);
}); Gives me the following output:
Try using |
I have the same warning when using the library $ node --trace-deprecation index.js Using mongoose 8.14.1 |
Would have any idea how to solve it or other way around
…On Thu, May 1, 2025, 3:04 PM Kenia Nya! ***@***.***> wrote:
*KeniaNya* left a comment (Automattic/mongoose#15358)
<#15358 (comment)>
I have the same warning when using the library
$ node --trace-deprecation index.js
(node:9872) [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:112:7)
at Function._load (node:internal/modules/cjs/loader:1100:17)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)
at Module.require (node:internal/modules/cjs/loader:1340:12)
at require (node:internal/modules/helpers:138:16)
at Object.
(C:\myProjects\myMongoDBApplication\node_modules\node-fetch\node_modules\whatwg-url\lib\url-state-machine.js:2:18)
Using mongoose 8.14.1
Node version 22.12.0
—
Reply to this email directly, view it on GitHub
<#15358 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDWDPIXFVIWEUWR5YHBM7KL24HTC5AVCNFSM6AAAAAB3HZCAUSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNBUGUZDOMBYHE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Prerequisites
Mongoose version
8.13.2
Node.js version
22.13.1
MongoDB server version
6.15.0
Typescript version (if applicable)
No response
Description
When using Mongoose, Node.js throws a deprecation warning related to the internal use of the punycode module.
Warning Message
(node:21076) [DEP0040] DeprecationWarning: The
punycodemodule is deprecated. Please use a userland alternative instead.
Steps to Reproduce
This happens because Node.js has officially deprecated the punycode module as mentioned in their documentation:
🔗Node Docs
But it seems that Mongoose (or one of its dependencies) is still using punycode through Node's core modules, which causes this warning.
Steps to Reproduce
link to the project
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: