image-charts / mjml-chart

<mj-chart/> for MJML framework
https://image-charts.com
78 stars 4 forks source link

TypeError when parsing mjml-chart #77

Open th-alexis opened 2 years ago

th-alexis commented 2 years ago

Hi devs,

I get the error:

TypeError: component.getTagName is not a function
    at ~/node_modules/mjml-parser-xml/lib/index.js:60:141
    at ~/node_modules/lodash/fp/_baseConvert.js:34:28
    at arrayMap (~/node_modules/lodash/_arrayMap.js:16:21)
    at map (~/node_modules/lodash/map.js:50:10)
    at wrapper (~/node_modules/lodash/_createHybrid.js:87:15)
    at ~/node_modules/lodash/fp/_baseConvert.js:455:19
    at wrapper (~/node_modules/lodash/_createHybrid.js:87:15)
    at ~/node_modules/lodash/_createFlow.js:71:31
    at MJMLParser (~/node_modules/mjml-parser-xml/lib/index.js:60:155)
    at mjml2html (~/node_modules/mjml-core/lib/index.js:219:39)

When adding the mj-chart tag to my mjml file. It happened just after adding the .mjmlconfig file, before that the chart was not showing on the emails.

If you guys need anything else from me let me know.

Thanks

mjml v4.10.1 mjml-chart v4

btourman commented 2 years ago

Hi @th-alexis,

I think the problem comes from the compatibility between mjml and mjml-chart version you use. mjml-chart v5.x.x is built for MJML4 and mjml-chart v4.x.x is built for MJML3

Could you try with mjml-chart v5 ? And let me know if you have the same error

Thanks