sighmon / mjml-rails

MJML + ERb/Haml/Slim view template
https://mjml.io
Other
300 stars 65 forks source link

MJML syntax issues #46

Closed kapso closed 5 years ago

kapso commented 5 years ago

I am getting these errors, even though the MJML docs don't mention any of these restrictions. These errors started showing up after I upgraded JS library 4.1.1 => 4.2.1

Mjml.setup do |config|
  config.template_language = :slim
  config.raise_render_exception = true
  config.mjml_binary_version_supported = "4.2.1" # I added this later to see if this fixes the issue, but it doesnt
end

Versions:

Errors:

ActionView::Template::Error (Line 1 of /var/folders/xx/bbv6bbfn22v0fg3jmxs87kpw0000gn/T/in20181213-26350-zdhsbs.mjml (mj-hero) — mj-hero cannot be used inside mj-column, only inside: mj-attributes, mj-body, mj-wrapper)
Line 1 of /var/folders/xx/bbv6bbfn22v0fg3jmxs87kpw0000gn/T/in20181213-26350-zdhsbs.mjml (mj-hero) — Attribute width is illegal
Line 9 of /var/folders/xx/bbv6bbfn22v0fg3jmxs87kpw0000gn/T/in20181213-26350-zdhsbs.mjml (mj-spacer) — mj-spacer cannot be used inside mj-section, only inside: mj-attributes, mj-column, mj-hero
Line 13 of /var/folders/xx/bbv6bbfn22v0fg3jmxs87kpw0000gn/T/in20181213-26350-zdhsbs.mjml (mj-spacer) — mj-spacer cannot be used inside mj-section, only inside: mj-attributes, mj-column, mj-hero

mjml-rails (4.2.4)

sighmon commented 5 years ago

@kapso Those are related to MJML changes. See their release notes: https://github.com/mjmlio/mjml/releases

kapso commented 5 years ago

Thats interesting. What I am curious is my code has now completely stopped working, even after I rolled back to MJML v4.1.1. It started breaking after 4.1.1 => 4.2.1 upgrade, so I rolled back, but no luck. Do you think this still a MJML lib issue?

sighmon commented 5 years ago

@kapso I couldn't get my MJML lib back to an older version once I'd upgraded, so I had to run with it. See #39.

Do you still have an <mj-container> in your mjml? The change to >= 4.2.1 forced removal of that from memory.

kapso commented 5 years ago

No I am not using any <mj-container>

kapso commented 5 years ago

Closing this issue, you are right no way to rollback the MJML version. I will work on fixing the MJML syntax issues. Thanks for the quick responses and your work on this gem 👍