-
Notifications
You must be signed in to change notification settings - Fork 968
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
Comments
First guess : I hate myself for coding this cli.
But it seems to behave as intended here as `mjml -w mjml/*.mjml -o
mjml/output/ & parcel index.html` will catch your header and try to compile
it.
I don't have any solution for you here as we don't have any ignore
pattern/directory built in into the cli
…On Mon, Feb 5, 2024 at 11:45 PM Ruslan Circhelan ***@***.***> wrote:
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
—
Reply to this email directly, view it on GitHub
<#2823>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAELHTOYBVQTN45X44E5FB3YSFOIDAVCNFSM6AAAAABC26T3TWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYTSNRQGE2TCOI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I moved "include" directory outside "mjml" and I see the same error in console |
I'll clone your sandbox and try to investigate a bit more, it's weird as
both 1 and 2 are rendered properly
…On Tue, Feb 6, 2024 at 12:28 AM Ruslan Circhelan ***@***.***> wrote:
I moved "include" directory outside "mjml" and I see the same error in
console
—
Reply to this email directly, view it on GitHub
<#2823 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAELHTKRBBU4JUHUWDEC763YSFTIRAVCNFSM6AAAAABC26T3TWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRYGQ4DSMJQGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
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
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
The text was updated successfully, but these errors were encountered: