-
Notifications
You must be signed in to change notification settings - Fork 965
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
mj-include tag throwing errors on style import and imports in the head tag #2837
Comments
Did you used watch for this ? |
i did use watch and it was rendering the files but I'm just worried in case something is going wrong. |
Try without watch it might be because of #2823 that should be fixed soon |
Can you try to open a repo to reproduce, it’s a bit hard to guess what could happen without playing with it.On 19 Mar 2024, at 01:10, Miroslav Naskovic ***@***.***> wrote:
So I tried it without watch and I would get the same output. It breaks the email (shown in the screenshot).
After fiddling around, I think it's something to do with the way the CSS has been imported. I have followed the documentation for this and it's still showing errors for the CSS imports with the mj-include.
Are you able to explain if I'm doing it correctly or not? And If not, how should I be including CSS for inline and responsive? I really need them in separate files because I am building a bunch of emails that should all have the base styles carried across from each email, and as the emails are updated, the styles are updated across all of them too.
Screenshot.2024-03-19.at.11.06.24.AM.png (view on web)
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So I've checked the fix for this in bafb24a, and followed the structure but I still get errors. It could be due to my set-up.
I have a file.mjml, which contains most of the markup. But I include files like
<mj-include path="./_includes/head.mjml" />
so that I can have multiple templates with the same styles and structure. I'm sure you can guess by now that I also include the style in the head.mjml.so my full code is:
for some reason, the mj-include tag is giving me errors on both the head.mjml and the CSS files:
_includes/head.mjml - Error while rendering the file : TypeError: Cannot read properties of undefined (reading 'push')
_css/default-inline.css - Error while rendering the file : Error: Parsing failed. Check your mjml.
_css/default.css - Error while rendering the file : Error: Parsing failed. Check your mjml.
and I can't for the life of me work this out
The text was updated successfully, but these errors were encountered: