GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
628 stars 226 forks source link

Error 'Cannot read property 'replace' of undefined' when upgrading grapesjs mjml version #263

Closed Sonal2695 closed 1 year ago

Sonal2695 commented 2 years ago

In our project, we are currently using v4.5.1 grapesjs mjml version. We need to upgrade it to above v4.8.0 to provide support for all the new styling attributes added for mj-column, mj-divider and mj-button. But when we change the version in package.json, we are getting below exception for some of the functionalities.

org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 Internal Server Error: **[{"error":"Cannot read property 'replace' of undefined"}]** at org.springframework.web.client.HttpServerErrorException.create(HttpServerErrorException.java:100) at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:172) at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:112) at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63) at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:782) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:740) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:674) atorg.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:418)`

I found a github thread where it was reported that this exception occurs for v4.10.3 so I tried using v4.10.2, v4.10.1 etc but same issue persist. github link: https://github.com/artf/grapesjs-mjml/issues/225

Any idea on how to upgrade the mjml version without impacting the current functionalities?

mlazovla commented 2 years ago

Hello, we had same bug. Check your mjml, it could start with <mjml> tag, not start with <body> tag.

artf commented 1 year ago

Duplicate of https://github.com/artf/grapesjs-mjml/issues/225