image-charts / mjml-chart

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

Error when registering custom component with latest #75

Open shinyidol opened 2 years ago

shinyidol commented 2 years ago

Installed pointed to js file and getting this error

user@MBP mjml % mjml --version
Error when registering custom component :  /opt/homebrew/lib/node_modules/mjml-chart/lib/index.js TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at registerCustomComponent (/opt/homebrew/lib/node_modules/mjml-chart/node_modules/mjml-core/lib/helpers/mjmlconfig.js:84:30)
    at /opt/homebrew/lib/node_modules/mjml-chart/node_modules/mjml-core/lib/helpers/mjmlconfig.js:87:7
    at Array.forEach (<anonymous>)
    at registerCustomComponent (/opt/homebrew/lib/node_modules/mjml-chart/node_modules/mjml-core/lib/helpers/mjmlconfig.js:86:15)
    at /opt/homebrew/lib/node_modules/mjml-chart/node_modules/mjml-core/lib/helpers/mjmlconfig.js:107:9
    at Array.forEach (<anonymous>)
    at handleMjmlConfigComponents (/opt/homebrew/lib/node_modules/mjml-chart/node_modules/mjml-core/lib/helpers/mjmlconfig.js:97:12)
    at handleMjmlConfig (/opt/homebrew/lib/node_modules/mjml-chart/node_modules/mjml-core/lib/helpers/mjmlconfig.js:139:10)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/mjml-chart/node_modules/mjml-core/lib/index.js:473:27)
mjml-core: 4.10.4
mjml-cli: 4.10.4

mjml-core: 4.10.4 mjml-cli: 4.10.4 mjml-chart: 6.0.1

FGRibreau commented 2 years ago

cc @btourman ?

btourman commented 2 years ago

Hi @shinyidol,

To be sure, are you trying to use custom component (mjml-chart) with cli ? Because, if it's the case, I think mjml cli is not yet ready for this : https://github.com/mjmlio/mjml-component-boilerplate#with-the-cli