payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
25.74k stars 1.64k forks source link

"[DEP0040] The punycode module is deprecated" with Node.js 22.4.0 #7346

Closed arraywaves closed 3 months ago

arraywaves commented 3 months ago

Link to reproduction

No response

Describe the Bug

  [nodemon] starting `ts-node src/server.ts -- -I`
  (node:53079) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
  (Use `node --trace-deprecation ...` to show where the warning was created)
  [20:32:27] INFO (payload): Connected to MongoDB server successfully!

To Reproduce

"dependencies": {
    "@payloadcms/bundler-webpack": "^1.0.0",
    "@payloadcms/db-mongodb": "^1.0.0",
    "@payloadcms/plugin-cloud": "^3.0.0",
    "@payloadcms/richtext-slate": "^1.0.0",
    "cross-env": "^7.0.3",
    "dotenv": "^8.2.0",
    "express": "^4.19.2",
    "payload": "^2.0.0"
  },
  "devDependencies": {
    "@types/express": "^4.17.9",
    "copyfiles": "^2.4.1",
    "nodemon": "^2.0.6",
    "ts-node": "^9.1.1",
    "typescript": "^4.8.4"
  }

npm run dev

Payload Version

2.0.0

Adapters and Plugins

db-mongodb

AlessioGr commented 3 months ago

You can prepend cross-env NODE_OPTIONS=--no-deprecation (or just NODE_OPTIONS=--no-deprecation if you don't care about Windows users) to your package.json scripts to fix this.

This is currently an issue with the node ecosystem, not payload, so we cannot fix this. Too many critical dependencies still depend on punycode like that

github-actions[bot] commented 2 months ago

This issue has been automatically locked. Please open a new issue if this issue persists with any additional detail.