mjml: [MJMLError] EmptyMJMLError

Hi,

I got this error while trying to use : $ mjml -w index.mjml

[MJMLError] EmptyMJMLError : Null element found in mjmlElementParser

I try this one, and it’s work without error : $> mjml -r index.mjml

I took this code for the test :

<mj-body>
  <mj-section>
    <mj-column>
      <mj-text>Hi sexy!</mj-text>
    </mj-column>
  </mj-section>
</mj-body>

Version mjml : 1.2.1

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (8 by maintainers)

Most upvoted comments

Can you test this in 2.0.2 ? Thanks !

Node v5.10.1 mjml v2.0.0

<mjml background-color="#F9F9F9">
  <mj-body>

    <mj-section>
      <mj-text>abc</mj-text>
    </mj-section>
  </mj-body>
</mjml>

mjml -w input.mjml -o output.html

Warning: Please upgrade your MJML markup to add a <mjml> root tag, <mj-body> as root will no longer be supported soon, see https://github.com/mjmlio/mjml/UPGRADE.MD
TypeError: Cannot read property 'length' of undefined
    at documentParser (/usr/local/lib/node_modules/mjml/node_modules/mjml-core/lib/parsers/document.js:97:11)
    at MJMLRenderer.parseDocument (/usr/local/lib/node_modules/mjml/node_modules/mjml-core/lib/MJMLRenderer.js:109:45)
    at new MJMLRenderer (/usr/local/lib/node_modules/mjml/node_modules/mjml-core/lib/MJMLRenderer.js:76:12)
    at /usr/local/lib/node_modules/mjml/node_modules/mjml-cli/lib/client.js:107:12

Works normally in mjml v1.3.4

Hi,

Just updated to mjml v2.0.0 and tried the example that @JacquelinClement gave, and got the following:

TypeError: Cannot read property 'length' of undefined
    at documentParser (/usr/lib/node_modules/mjml/node_modules/mjml-core/lib/parsers/document.js:97:11)
    at MJMLRenderer.parseDocument (/usr/lib/node_modules/mjml/node_modules/mjml-core/lib/MJMLRenderer.js:109:45)
    at new MJMLRenderer (/usr/lib/node_modules/mjml/node_modules/mjml-core/lib/MJMLRenderer.js:76:12)
    at /usr/lib/node_modules/mjml/node_modules/mjml-cli/lib/client.js:107:12

Am I doing something wrong? Using node v0.12.13 on Ubuntu 14.04 btw