Faire / mjml-react

React component library to generate the HTML emails on the fly
https://www.npmjs.com/package/@faire/mjml-react
MIT License
375 stars 16 forks source link

Cannot find module '@faire/mjml-react/utils/render' #108

Open Jarrodsz opened 8 months ago

Jarrodsz commented 8 months ago

In a new remix v2 project im getting a

Cannot find module '@faire/mjml-react/utils/render' 

the file exists.

I suspect the new remix v2 esm like stuff is breaking this.

What is the best advice to resolve this?

Jarrodsz commented 8 months ago

basically this module import is failing:

import {render} from "@faire/mjml-react/utils/render";
emmclaughlin commented 8 months ago

Hi @Jarrodsz,

Unfortunately I have not used remix v2 with mjml-react, so I don't know the best way to fix this. I would need to know more about your setup to help debug the problem.

In general though, the render function in mjml-react is just one way of rendering mjml-react to html and isn't necessarily the best way for every application. It should be easy to implement your own. Under the hood it is just ReactDOMServer.renderToStaticMarkup to convert the react mjml to mjml, mjml2html to convert the mjml to html, and a minifier to minify the html (this is optional, and any minifier should work).