Mjml-cli prints errors to a stdout, and they mix with rendered html code
See original GitHub issueMjml-cli currently prints warnings to a stdout, same as the rendered html template. This is a problem because when I compile templates like this mjml index.mjml > index.html
, I don’t see any problems, and I risk accidentally sending an email that begins with mjml error messages.
Reproduction Steps:
Create a template with warning, for example by using a mj component in a scope where it doesn’t belong.
Expected behavior:
Errors are sent to stderr (console.error()
) while the output appears on stdout (console.log()
).
Observed behavior:
Both errors and output is sent to stdout, and errors appear at the beginning of compiled template.
MJML version:
4.1.2
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
mjml-guides – Documentation for MJML - The Responsive ...
MJML Guides. MJML is a markup language designed to reduce the pain of coding a responsive email. Its semantic syntax makes it easy...
Read more >mjml - npm
MJML is a markup language created by Mailjet and designed to reduce the pain of coding a responsive email. Its semantic syntax makes...
Read more >How do I write standard error to a file while using "tee" with a ...
I'm assuming you want to still see standard error and standard output on the terminal. You could go for Josh Kelley's answer, but...
Read more >Writing Error Messages to Standard Error Instead of Standard ...
First, let's observe how all content printed by minigrep is currently being written to standard output, including error messages that we want to...
Read more >Standard output, standard error and command line redirection
If the user wants to see only the regular output, they can redirect the error channel to a file and examine it later,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I disagree with this -
stdout
should only be used for the actual output (so that you can redirect it to a file, and be sure you aren’t sending your users an email with validation messages).All diagnostic output should go to
stderr
, and I propose to add setting to select verbosity (warnings and errors, or errors only).Hi @tkafka it’s true that errors could be sent to stderr, we’ll see for changing that in 4.3 Meanwhile, if you compile with
mjml index.mjml -o index.html
you have no risk to have errors in the output