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

punycode module is deprecated in MJML 4.15.3 on Node.js 22.12.0 LTS #2930

Open
mudge opened this issue Jan 8, 2025 · 5 comments
Open

punycode module is deprecated in MJML 4.15.3 on Node.js 22.12.0 LTS #2930

mudge opened this issue Jan 8, 2025 · 5 comments

Comments

@mudge
Copy link

mudge commented Jan 8, 2025

Describe the bug
Using MJML on the current LTS version of Node.js (22.12.0) will emit the following deprecation warning:

W, [2025-01-08T13:35:55.110352 #46507]  WARN -- Mjml: (node:46643) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

To Reproduce
Steps to reproduce the behavior:

  1. Create a file called test.mjml with this MJML code: <mjml><mj-body><mj-section><mj-column><mj-text>Hello World</mj-text></mj-column></mj-section></mj-body></mjml>
  2. Render it to HTML by doing 'mjml test.mjml' on Node.js 22.12.0
  3. See deprecation warning

Expected behavior
No deprecation warning should be emitted.

MJML environment (please complete the following information):

  • OS: macOS 15.2
  • MJML Version: 4.15.3
  • MJML tool used: mjml JavaScript package

Additional context
This was previously discussed in #2843 and is seemingly fixed in the alpha versions of MJML 5: would it be possible to backport the fix to MJML 4?

@iRyusa
Copy link
Member

iRyusa commented Jan 8, 2025

Not on top of my priority for now, you should use the 5.x branch instead

@mudge
Copy link
Author

mudge commented Jan 8, 2025

We're using MJML with MJML-Rails which explicitly checks for version 4 and raises an error if mjml --version doesn't match. We could override that or is it worth raising an issue with that project for version 5 support if that is what is now recommended (despite still being in alpha)?

@iRyusa
Copy link
Member

iRyusa commented Jan 8, 2025 via email

@mudge
Copy link
Author

mudge commented Jan 8, 2025

Thanks for taking the time to look at this.

The diff between 4.15.3 and 5.0.0-alpha.6 seems reasonable and MJML-Rails' mjml_binary_version_supported is designed to be configurable so I'm happy to customise this in our own applications to switch to MJML 5.

Would it be worth making a GitHub release for https://github.com/mjmlio/mjml/releases/tag/v5.0.0-alpha.6 (still marking it as a prerelease) and summarising the changes from 4 in order to indicate its readiness for use?

@iRyusa
Copy link
Member

iRyusa commented Jan 8, 2025 via email

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

2 participants