remorses/vitro

Support for SSR

Opened this issue · 0 comments

Hello, I'm trying to render html emails generated with mjml-react in vitro. But currently mjml can only be used in node and I get an error when I import the library inside of a story. Would it be possible to render the React components in node and serve static html to the client?

Btw, this is the error I get:

ReferenceError: require is not defined
    at http://localhost:7007/.bundless/web_modules/index-NXV45NRR.js?namespace=file&t=964d978a0:41194:5
    at http://localhost:7007/.bundless/web_modules/chunks/chunk-XD5ZKPOL.js?namespace=file&t=eedfd9ea0:8:45
    at http://localhost:7007/.bundless/web_modules/index-NXV45NRR.js?namespace=file&t=964d978a0:41311:18
    at http://localhost:7007/.bundless/web_modules/chunks/chunk-XD5ZKPOL.js?namespace=file&t=eedfd9ea0:8:45
    at http://localhost:7007/.bundless/web_modules/index-NXV45NRR.js?namespace=file&t=964d978a0:63559:23
    at http://localhost:7007/.bundless/web_modules/chunks/chunk-XD5ZKPOL.js?namespace=file&t=eedfd9ea0:8:45
    at http://localhost:7007/.bundless/web_modules/index-NXV45NRR.js?namespace=file&t=964d978a0:68875:43
    at http://localhost:7007/.bundless/web_modules/chunks/chunk-XD5ZKPOL.js?namespace=file&t=eedfd9ea0:8:45
    at http://localhost:7007/.bundless/web_modules/index-NXV45NRR.js?namespace=file&t=964d978a0:85568:30