parcel-bundler / parcel

The zero configuration build tool for the web. 📦🚀
https://parceljs.org
MIT License
43.41k stars 2.26k forks source link

Deprecated punycode module msg #9390

Open grishy opened 10 months ago

grishy commented 10 months ago

🐛 bug report

🎛 Configuration (.babelrc, package.json, cli command)

Default one and parcel pages/index.pug

{
  "name": "test",
  "private": true,
  "scripts": {
    "dev": "parcel pages/index.pug",
    "pretty": "prettier --write ."
  },
  "devDependencies": {
    "prettier": "3.1.0"
  },
  "dependencies": {
    "@parcel/transformer-pug": "2.10.3",
    "@parcel/transformer-sass": "2.10.3",
    "parcel": "2.10.3"
  }
}

🤔 Expected Behavior

Without DeprecationWarning.

😯 Current Behavior

npm run dev                                 

> grishy-blog@1.0.0 dev
> parcel pages/index.pug

(node:15138) [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:392:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:328:10)
    at loadBuiltinModule (node:internal/modules/helpers:101:7)
    at Module._load (node:internal/modules/cjs/loader:1001:17)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at NodePackageManager.load (/Users/grishy/projects/lab/blog/node_modules/@parcel/package-manager/lib/index.js:3565:16)
    at NodePackageManager.requireSync (/Users/grishy/projects/lab/blog/node_modules/@parcel/package-manager/lib/index.js:3560:21)
    at m.require (/Users/grishy/projects/lab/blog/node_modules/@parcel/package-manager/lib/index.js:3584:25)
Server running at http://localhost:1234
✨ Built in 9ms

💁 Possible Solution

Update or change import path.
Related:

🔦 Context

Each time we have msg at the beginning.

💻 Code Sample

Any cfg, I suppose.

🌍 Your Environment

Software Version(s)
Parcel 2.10.3
Node v21.2.0
npm/Yarn 10.2.3
Operating System macOS
mischnic commented 10 months ago

See https://github.com/vercel/serve-handler/issues/204 So punycode is used by a transitive dependency.

iacore commented 6 months ago

Maybe we should fork vercel/serve-handler, since it seems unmaintained.

polobo commented 2 months ago

Without some kind of fork this is unlikely to get resolved. Thus, is the idea to add it to the monorepo as a package (or just private?), in which case a pull request is possible, or to setup a separate fork git repo and publish that to npm, which would seem to preclude any community assistance?

(Not offering here atm but am hoping to unstall this as I begin my first project using parcel.)

Separately, is the desire to take in the fast-url-parser dependency also, unconditionally, swap to url unconditionally, or make a performance test after moving over server-handler to see if fast-url-parser is still an improvement after all this time?

arimus commented 2 days ago

For others who find this issue that I ended up with this problem when upgrading to Node v22.6.0, but when I went back to v20.12.0 the error went away.