Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message on watching templates with includes (mj-include) #2823

Closed
Russellmd opened this issue Feb 5, 2024 · 4 comments · Fixed by #2838
Closed

Error message on watching templates with includes (mj-include) #2823

Russellmd opened this issue Feb 5, 2024 · 4 comments · Fixed by #2838

Comments

@Russellmd
Copy link

Using the watch with templates that use also "mj-inlcude" generate an error message:

Now watching file: /workspace/mjml/1.html.mjml
Now watching file: /workspace/mjml/2.html.mjml
⏳ Building hmr-runtime.js...
/workspace/mjml/1.html.mjml - Change detected
⏳ Building 1.html...
/workspace/mjml/include/header.mjml - Change detected
/workspace/mjml/include/header.mjml - Error while rendering the file : Error: Malformed MJML. Check that your structure is correct and enclosed in <mjml> tags.
at mjml2html (/workspace/node_modules/mjml-core/lib/index.js:359:11)
at readAndCompile.compiled.errors.errors (/workspace/node_modules/mjml-cli/lib/commands/watchFiles.js:65:44)
at /workspace/node_modules/lodash/_createFlow.js:71:31
at /workspace/node_modules/mjml-cli/lib/commands/watchFiles.js:110:9
at Array.forEach (<anonymous>)
at Timeout._onTimeout (/workspace/node_modules/mjml-cli/lib/commands/watchFiles.js:107:11)
at listOnTimeout (node:internal/timers:573:17)
⏳ Building 2.html...
/workspace/mjml/1.html.mjml - Successfully compiled

However, files are compiled and seems that the generate HTML is the expected one. On generating output without "watch" option there are no error messages.

Tested with MJML 4.15.3
Sandbox to reproduce: https://codesandbox.io/p/devbox/38wzpz

@iRyusa
Copy link
Member

iRyusa commented Feb 5, 2024 via email

@Russellmd
Copy link
Author

I moved "include" directory outside "mjml" and I see the same error in console

@iRyusa
Copy link
Member

iRyusa commented Feb 5, 2024 via email

@iRyusa
Copy link
Member

iRyusa commented Feb 13, 2024

Thanks a lot for the sandbox @Russellmd found out the issue ! 👍 Patch should be available next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants