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

DeprecationWarning: The punycode module is deprecated on node 21 #2843

Closed
srghma opened this issue Mar 7, 2024 · 12 comments
Closed

DeprecationWarning: The punycode module is deprecated on node 21 #2843

srghma opened this issue Mar 7, 2024 · 12 comments

Comments

@srghma
Copy link

srghma commented Mar 7, 2024

To Reproduce

$ node -v
v21.0.0

multiline_string="
<mjml>
  <mj-head>
    <mj-breakpoint width="320px" />
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>
          Hello World!
        </mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>
"

# Echo the multiline string to a file in the temporary directory
echo "$multiline_string" > /tmp/multiline_file.txt

node --trace-deprecation node_modules/.bin/mjml -- /tmp/multiline_file.txt -s
...compiled output

(node:460032) [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:102:7)
    at Module._load (node:internal/modules/cjs/loader:995:17)
    at Module.require (node:internal/modules/cjs/loader:1229:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/home/srghma/projects/adsfasdf/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)

Expected behavior
no warning to stderr

MJML environment (please complete the following information):

  • OS: Nixos
  • mjml-core: 4.15.3
  • mjml-cli: 4.15.3
srghma added a commit to srghma/mjml-premailer that referenced this issue Mar 7, 2024
@iRyusa
Copy link
Member

iRyusa commented Mar 19, 2024

Looks to be related to web-resource-inliner which is used in Juice. IDK if they gonna fix it on their end ?

@alfonsrv
Copy link

alfonsrv commented Jun 9, 2024

Unlikely. web-resource-inliner (the maintainer of juice) is looking for someone to take over their repo (Automattic/juice#399)

I have opened an issue on the repo, but this issue has been around for quite some time now. jrit/web-resource-inliner#84

@johnwhelchel
Copy link

Anyone know of a workaround for this?

@iRyusa
Copy link
Member

iRyusa commented Aug 13, 2024

Not for now, I've opened a PR on web-resource-inliner, let's hope they will be able to merge it :D

@SimenB
Copy link

SimenB commented Aug 21, 2024

^ has been merged and released

@iRyusa
Copy link
Member

iRyusa commented Aug 21, 2024

Juice is still using the 6.x version of this so it's still not available yet

@CarsonF
Copy link

CarsonF commented Aug 21, 2024

Thank you @iRyusa @jrit!
I opened a PR for Juice: Automattic/juice#497

@CarsonF
Copy link

CarsonF commented Aug 22, 2024

Alright @iRyusa on to you

@iRyusa
Copy link
Member

iRyusa commented Aug 27, 2024

I should be able to release in the next build of MJML5 where I need to tweak few things in it

@iRyusa
Copy link
Member

iRyusa commented Oct 4, 2024

Juice has been updated to v11 on 5.0.0-alpha.6 this should fix it

@iRyusa iRyusa closed this as completed Oct 4, 2024
@samstickland
Copy link

@iRyusa I still get this error. Using the example in the original post it reports:

(node:96250) [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:114:7)
    at Function._load (node:internal/modules/cjs/loader:1100:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1340:12)
    at require (node:internal/modules/helpers:141:16)
    at Object.<anonymous> (/Users/sam/development/hubbado/hubbado_core/node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
mjml-core: 4.15.3
mjml-cli: 4.15.3
node -v
v22.11.0

yarn outdated doesn't report anything that looks relevant:

@selectize/selectize 0.15.2  exotic exotic dependencies    selectize/selectize.js#e6ca6d3ba8f902c38da157f2caf7962c38e82095
postcss-preset-env   10.1.2  10.1.3 10.1.3 dependencies    https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env#readme
sass                 1.83.0  1.83.1 1.83.1 devDependencies https://github.com/sass/dart-sass
vite                 6.0.5   6.0.7  6.0.7  dependencies    https://vite.dev
vue-i18n             10.0.5  11.0.1 11.0.1 dependencies    https://github.com/intlify/vue-i18n/tree/master/packages/vue-i18n#readme

I've tried upgrading the packages too and it hasn't made any difference

@reyhan-affandie
Copy link

i solve that punycode issues by changing the node version
from 22.13.1 (LTS) to 20.18.2(LTS) or 18.20.6(LTS)

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

8 participants