mjml icon indicating copy to clipboard operation
mjml copied to clipboard

DeprecationWarning: The `punycode` module is deprecated on node 21

Open srghma opened this issue 11 months ago • 9 comments

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 avatar Mar 07 '24 05:03 srghma

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

iRyusa avatar Mar 19 '24 15:03 iRyusa

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

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

alfonsrv avatar Jun 09 '24 14:06 alfonsrv

Anyone know of a workaround for this?

johnwhelchel avatar Jul 24 '24 19:07 johnwhelchel

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

iRyusa avatar Aug 13 '24 15:08 iRyusa

^ has been merged and released

SimenB avatar Aug 21 '24 09:08 SimenB

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

iRyusa avatar Aug 21 '24 09:08 iRyusa

Thank you @iRyusa @jrit! I opened a PR for Juice: https://github.com/Automattic/juice/pull/497

CarsonF avatar Aug 21 '24 14:08 CarsonF

Alright @iRyusa on to you

CarsonF avatar Aug 22 '24 17:08 CarsonF

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

iRyusa avatar Aug 27 '24 09:08 iRyusa