Mjml: Soft dependencies version breaks existing software on each new MJML release

Created on 28 Nov 2018  ·  14Comments  ·  Source: mjmlio/mjml

MJML use caret range version to pin internal dependencies.

^4.1.2 is equals to ≥4.1.2 <5.0.0, so on each new minor release of MJML, existing software using previous release are forced to upgrade all inner mjml-* dependencies.

$ cat package.json 
{
    "dependencies": {
        "mjml": "4.1.2"
    }
}
$ yarn
success Saved lockfile.
$ ./node_modules/.bin/mjml --version
mjml-core: 4.2.1
mjml-cli: 4.2.1

It breaks at least softwares expecting specific MJML version, like mjml-rails and generate unreproductible builds (using MJML 4.1.2 before the 4.1.3 release is not the same as using it after).

It would be better to pin internal dependencies to the exact same version as the main MJML package, or to use at least tilde range version to avoid minor version change.

Most helpful comment

I don't really see tilde as an issue IMO, as minor patch only provide fix
introduced in the branch, I've fucked up merging a PR that was aimed for
4.3.0 and released it among a minor patch ( note that it only affect people
that still use MJML3 syntax over MJML 4, after a year )

Tilde was an accepted solution in MJML3, and we didn't have any complaints
about it for a while. As we moved on lerna, to ease package management, we
didn't saw that mistake and it's good that someone found it, so we can
either go on tilde again, or pinning the version.

this as a viable solution for production anymore because of this
unpredictability.

Lock files is a viable solution to pin package version also, you can also
just enumerate the different package for MJML in your package.json like
here https://github.com/mjmlio/mjml/blob/master/packages/mjml/package.json

After this biting us twice with the past 2 releases - 4.2.0 and 4.2.1,
and killing developer time to just try to figure out why suddenly email
isn't rendering

I feel like we try to reply on Github & Slack & fix ASAP issues introduced
in any minor or major patch.

But I think that brings up another question of why are patch releases
introducing breaking changes?

It's open source and free, we do some mistakes, we're not perfect. So, feel
free to take some of your free time, like us, to reply to some MJML users &
fix bugs in it too :)

On Sat, Dec 1, 2018 at 2:32 AM Phillip Novess notifications@github.com
wrote:

~ & ^ both seem like unacceptable solutions. @aeris
https://github.com/aeris solution seems like the best, pin the internal
version dependancies to exact versions. Currently the way this project is
organized, I don't see how you can install the version you actually want. I
put "4.2.0" in my package.json file, I expect to have that installed.

After this biting us twice with the past 2 releases - 4.2.0 and 4.2.1, and
killing developer time to just try to figure out why suddenly email isn't
rendering, and trying to enforce a stable version, we are on the cusp of
dumping this as a viable solution for production anymore because of this
unpredictability. And that is with just with the past 2 patch releases. But
I think that brings up another question of why are patch releases
introducing breaking changes?

Please offer any suggestions. We would love to use this is awesome
project. Unfortunately, we don't have the luxury of every deploy possibly
breaking cause we can't control the package version.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/mjmlio/mjml/issues/1442#issuecomment-443387689, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAizzefdaADCjNfy0pZ5hhAAZRGkYR7Tks5u0dxDgaJpZM4Y4DPX
.

All 14 comments

Hi @aeris
Yup, you're right it's weird that we've switched from tilde to carret, it was a tilde on MJML3 cf: https://github.com/mjmlio/mjml/blob/3.3.x/packages/mjml/package.json

We probably miss this change while moving on lerna 🤔

~ & ^ both seem like unacceptable solutions. @aeris solution seems like the best, pin the internal version dependancies to exact versions. Currently the way this project is organized, I don't see how you can install the version you actually want. I put "4.2.0" in my package.json file, I expect to have that installed.

After this biting us twice with the past 2 releases - 4.2.0 and 4.2.1, and killing developer time to just try to figure out why suddenly email isn't rendering, and trying to enforce a stable version, we are on the cusp of dumping this as a viable solution for production anymore because of this unpredictability. And that was with patch releases. But I think that brings up another question, why are patch releases introducing breaking changes?

Please offer any suggestions. We would love to use this awesome project. Unfortunately, we don't have the luxury of every deploy possibly breaking cause we can't control the package version.

https://github.com/sighmon/mjml-rails/issues/39#issuecomment-429509358

I don't really see tilde as an issue IMO, as minor patch only provide fix
introduced in the branch, I've fucked up merging a PR that was aimed for
4.3.0 and released it among a minor patch ( note that it only affect people
that still use MJML3 syntax over MJML 4, after a year )

Tilde was an accepted solution in MJML3, and we didn't have any complaints
about it for a while. As we moved on lerna, to ease package management, we
didn't saw that mistake and it's good that someone found it, so we can
either go on tilde again, or pinning the version.

this as a viable solution for production anymore because of this
unpredictability.

Lock files is a viable solution to pin package version also, you can also
just enumerate the different package for MJML in your package.json like
here https://github.com/mjmlio/mjml/blob/master/packages/mjml/package.json

After this biting us twice with the past 2 releases - 4.2.0 and 4.2.1,
and killing developer time to just try to figure out why suddenly email
isn't rendering

I feel like we try to reply on Github & Slack & fix ASAP issues introduced
in any minor or major patch.

But I think that brings up another question of why are patch releases
introducing breaking changes?

It's open source and free, we do some mistakes, we're not perfect. So, feel
free to take some of your free time, like us, to reply to some MJML users &
fix bugs in it too :)

On Sat, Dec 1, 2018 at 2:32 AM Phillip Novess notifications@github.com
wrote:

~ & ^ both seem like unacceptable solutions. @aeris
https://github.com/aeris solution seems like the best, pin the internal
version dependancies to exact versions. Currently the way this project is
organized, I don't see how you can install the version you actually want. I
put "4.2.0" in my package.json file, I expect to have that installed.

After this biting us twice with the past 2 releases - 4.2.0 and 4.2.1, and
killing developer time to just try to figure out why suddenly email isn't
rendering, and trying to enforce a stable version, we are on the cusp of
dumping this as a viable solution for production anymore because of this
unpredictability. And that is with just with the past 2 patch releases. But
I think that brings up another question of why are patch releases
introducing breaking changes?

Please offer any suggestions. We would love to use this is awesome
project. Unfortunately, we don't have the luxury of every deploy possibly
breaking cause we can't control the package version.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/mjmlio/mjml/issues/1442#issuecomment-443387689, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAizzefdaADCjNfy0pZ5hhAAZRGkYR7Tks5u0dxDgaJpZM4Y4DPX
.

Lock files is a viable solution to pin package version also, you can also just enumerate the different package for MJML in your package.json like here https://github.com/mjmlio/mjml/blob/master/packages/mjml/package.json

Lock file is not possible for new project.
And pinning packages for every dependency doesn't work too.

a70c21a8b5288b19

@iRyusa thank you for the quick reply. Yeah I appreciate the perspective and understand completely. I just am not sure how anyone can use the project in production with this circular dependency issue. We added mjml to bring more consistency, which it did til we had to do another deploy. I just don't know any other options. I mean that as in please tell me what I'm doing wrong. :)

I'm kinda at the point of having to fork the project and hard code the package.json files. I also contemplated maybe archiving my old node_modules folder and copying that around. Which both just sound completely wrong.

@aeris It looks like it does work fine on npm :

➜ mjmltest yarn mjml --version
yarn run v1.12.3
$ /Users/maximebrazeilles/mjmltest/node_modules/.bin/mjml --version
mjml-core: 4.1.2
mjml-cli: 4.1.2

{
  "name": "mjmltest",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "mjml": "4.1.2",
    "mjml-accordion": "4.1.2",
    "mjml-body": "4.1.2",
    "mjml-button": "4.1.2",
    "mjml-carousel": "4.1.2",
    "mjml-cli": "4.1.2",
    "mjml-column": "4.1.2",
    "mjml-core": "4.1.2",
    "mjml-divider": "4.1.2",
    "mjml-group": "4.1.2",
    "mjml-head": "4.1.2",
    "mjml-head-attributes": "4.1.2",
    "mjml-head-breakpoint": "4.1.2",
    "mjml-head-font": "4.1.2",
    "mjml-head-preview": "4.1.2",
    "mjml-head-style": "4.1.2",
    "mjml-head-title": "4.1.2",
    "mjml-hero": "4.1.2",
    "mjml-image": "4.1.2",
    "mjml-migrate": "4.1.2",
    "mjml-navbar": "4.1.2",
    "mjml-raw": "4.1.2",
    "mjml-section": "4.1.2",
    "mjml-social": "4.1.2",
    "mjml-spacer": "4.1.2",
    "mjml-table": "4.1.2",
    "mjml-parser-xml": "4.1.2",
    "mjml-text": "4.1.2",
    "mjml-validator": "4.1.2",
    "mjml-wrapper": "4.1.2"
  }
}

I just am not sure how anyone can use the project in production with this circular dependency issue.

Multiple project are using it in production without any issue, i feel that the version detection in mjml-rails is a bit naïve and should be done like that.

But any way, it shouldn't be "that" hard to install a previous version of MJML. We're gonna switch from carret to tilde as it was before.

As we can't change things from past release from 4.0 to today, we'll discuss if we fix the version or revert to tilde as we've done on MJML3

@iRyusa In practice it doesn't work, some dependencies are 4.2.1 and not 4.1.2, and so the behavior is quite unpredictable

And in my case, I don't have the same output than yours (and prove the unpredictable behavior of current mjml package).

$ yarn --version                                      
1.12.3
$ cat package.json
{
  "name": "mjmltest",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "mjml": "4.1.2",
    "mjml-accordion": "4.1.2",
    "mjml-body": "4.1.2",
    "mjml-button": "4.1.2",
    "mjml-carousel": "4.1.2",
    "mjml-cli": "4.1.2",
    "mjml-column": "4.1.2",
    "mjml-core": "4.1.2",
    "mjml-divider": "4.1.2",
    "mjml-group": "4.1.2",
    "mjml-head": "4.1.2",
    "mjml-head-attributes": "4.1.2",
    "mjml-head-breakpoint": "4.1.2",
    "mjml-head-font": "4.1.2",
    "mjml-head-preview": "4.1.2",
    "mjml-head-style": "4.1.2",
    "mjml-head-title": "4.1.2",
    "mjml-hero": "4.1.2",
    "mjml-image": "4.1.2",
    "mjml-migrate": "4.1.2",
    "mjml-navbar": "4.1.2",
    "mjml-raw": "4.1.2",
    "mjml-section": "4.1.2",
    "mjml-social": "4.1.2",
    "mjml-spacer": "4.1.2",
    "mjml-table": "4.1.2",
    "mjml-parser-xml": "4.1.2",
    "mjml-text": "4.1.2",
    "mjml-validator": "4.1.2",
    "mjml-wrapper": "4.1.2"
  }
}
$ yarn
$ ./node_modules/.bin/mjml --version
mjml-core: 4.2.1
mjml-cli: 4.2.1
$ grep -A1 mjml yarn.lock | grep -B1 'version "4.2.1"'
mjml-accordion@^4.1.2:
  version "4.2.1"
mjml-body@^4.1.2:
  version "4.2.1"
mjml-button@^4.1.2:
  version "4.2.1"
mjml-carousel@^4.1.2:
  version "4.2.1"
mjml-cli@^4.1.2:
  version "4.2.1"
mjml-column@^4.1.2:
  version "4.2.1"
mjml-core@^4.1.2, mjml-core@^4.2.1:
  version "4.2.1"
mjml-divider@^4.1.2:
  version "4.2.1"
mjml-group@^4.1.2:
  version "4.2.1"
mjml-head-attributes@^4.1.2:
  version "4.2.1"
mjml-head-breakpoint@^4.1.2:
  version "4.2.1"
mjml-head-font@^4.1.2:
  version "4.2.1"
mjml-head-preview@^4.1.2:
  version "4.2.1"
mjml-head-style@^4.1.2:
  version "4.2.1"
mjml-head-title@^4.1.2:
  version "4.2.1"
mjml-head@^4.1.2:
  version "4.2.1"
mjml-hero@^4.1.2:
  version "4.2.1"
mjml-image@^4.1.2:
  version "4.2.1"
mjml-migrate@^4.1.2, mjml-migrate@^4.2.1:
  version "4.2.1"
mjml-navbar@^4.1.2:
  version "4.2.1"
mjml-parser-xml@^4.1.2, mjml-parser-xml@^4.2.1:
  version "4.2.1"
mjml-raw@^4.1.2:
  version "4.2.1"
mjml-section@^4.1.2, mjml-section@^4.2.1:
  version "4.2.1"
mjml-social@^4.1.2:
  version "4.2.1"
mjml-spacer@^4.1.2:
  version "4.2.1"
mjml-table@^4.1.2:
  version "4.2.1"
mjml-text@^4.1.2:
  version "4.2.1"
mjml-validator@^4.1.2, mjml-validator@^4.2.1:
  version "4.2.1"
mjml-wrapper@^4.1.2:
  version "4.2.1"

And at the end, there is a bunch of mix of 4.1.2 and 4.2.1:

$ find -wholename "./node_modules/mjml*/package.json" | xargs grep version
./node_modules/mjml-wrapper/package.json:  "version": "4.1.2",
./node_modules/mjml-wrapper/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-wrapper/node_modules/mjml-section/package.json:  "version": "4.2.1",
./node_modules/mjml-wrapper/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-wrapper/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-wrapper/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-validator/package.json:  "version": "4.1.2",
./node_modules/mjml-validator/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-validator/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-validator/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-validator/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-text/package.json:  "version": "4.1.2",
./node_modules/mjml-text/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-text/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-text/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-text/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-table/package.json:  "version": "4.1.2",
./node_modules/mjml-table/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-table/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-table/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-table/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-spacer/package.json:  "version": "4.1.2",
./node_modules/mjml-spacer/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-spacer/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-spacer/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-spacer/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-social/package.json:  "version": "4.1.2",
./node_modules/mjml-social/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-social/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-social/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-social/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-section/package.json:  "version": "4.1.2",
./node_modules/mjml-section/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-section/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-section/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-section/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-raw/package.json:  "version": "4.1.2",
./node_modules/mjml-raw/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-raw/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-raw/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-raw/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-parser-xml/package.json:  "version": "4.1.2",
./node_modules/mjml-navbar/package.json:  "version": "4.1.2",
./node_modules/mjml-navbar/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-navbar/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-navbar/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-navbar/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-migrate/package.json:  "version": "4.1.2",
./node_modules/mjml-migrate/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-migrate/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-migrate/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-migrate/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-image/package.json:  "version": "4.1.2",
./node_modules/mjml-image/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-image/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-image/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-image/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-hero/package.json:  "version": "4.1.2",
./node_modules/mjml-hero/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-hero/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-hero/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-hero/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-head-title/package.json:  "version": "4.1.2",
./node_modules/mjml-head-title/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-head-title/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-head-title/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-head-title/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-head-style/package.json:  "version": "4.1.2",
./node_modules/mjml-head-style/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-head-style/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-head-style/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-head-style/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-head-preview/package.json:  "version": "4.1.2",
./node_modules/mjml-head-preview/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-head-preview/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-head-preview/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-head-preview/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-head-font/package.json:  "version": "4.1.2",
./node_modules/mjml-head-font/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-head-font/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-head-font/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-head-font/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-head-breakpoint/package.json:  "version": "4.1.2",
./node_modules/mjml-head-breakpoint/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-head-breakpoint/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-head-breakpoint/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-head-breakpoint/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-head-attributes/package.json:  "version": "4.1.2",
./node_modules/mjml-head-attributes/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-head-attributes/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-head-attributes/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-head-attributes/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-head/package.json:  "version": "4.1.2",
./node_modules/mjml-head/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-head/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-head/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-head/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-group/package.json:  "version": "4.1.2",
./node_modules/mjml-group/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-group/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-group/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-group/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-divider/package.json:  "version": "4.1.2",
./node_modules/mjml-divider/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-divider/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-divider/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-divider/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-core/package.json:  "version": "4.1.2",
./node_modules/mjml-core/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-core/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-core/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-core/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-column/package.json:  "version": "4.1.2",
./node_modules/mjml-column/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-column/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-column/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-column/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-cli/package.json:  "version": "4.1.2",
./node_modules/mjml-cli/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-cli/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-cli/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-cli/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-carousel/package.json:  "version": "4.1.2",
./node_modules/mjml-carousel/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-carousel/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-carousel/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-carousel/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-button/package.json:  "version": "4.1.2",
./node_modules/mjml-button/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-button/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-button/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-button/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-body/package.json:  "version": "4.1.2",
./node_modules/mjml-body/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-body/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-body/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-body/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml-accordion/package.json:  "version": "4.1.2",
./node_modules/mjml-accordion/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml-accordion/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml-accordion/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml-accordion/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml/package.json:  "version": "4.1.2",
./node_modules/mjml/node_modules/mjml-wrapper/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-validator/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-text/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-table/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-spacer/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-social/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-section/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-raw/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-parser-xml/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-navbar/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-migrate/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-image/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-hero/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-head-title/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-head-style/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-head-preview/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-head-font/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-head-breakpoint/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-head-attributes/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-head/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-group/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-divider/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-core/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-column/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-cli/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-carousel/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-button/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-body/package.json:  "version": "4.2.1",
./node_modules/mjml/node_modules/mjml-accordion/package.json:  "version": "4.2.1",

```

npm doesn't have the same behavior for this exact situation, please try
with npm and you'll see that no 4.2.1 package should be installed as they
are pinned to 4.1.2.

I reproduce the issue with yarn, but it's most likely a wrong behavior from
yarn (might be actually good to see with yarn team if it's a bug?), as npm
is just following strictly the package json

On Sat, Dec 1, 2018 at 11:48 PM aeris notifications@github.com wrote:

@iRyusa https://github.com/iRyusa In practice it doesn't work, some
dependencies are 4.2.1 and not 4.1.2, and so the behavior is quite
unpredictable

$ yarn --version
1.12.3
$ cat package.json
{
"name": "mjmltest",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"mjml": "4.1.2",
"mjml-accordion": "4.1.2",
"mjml-body": "4.1.2",
"mjml-button": "4.1.2",
"mjml-carousel": "4.1.2",
"mjml-cli": "4.1.2",
"mjml-column": "4.1.2",
"mjml-core": "4.1.2",
"mjml-divider": "4.1.2",
"mjml-group": "4.1.2",
"mjml-head": "4.1.2",
"mjml-head-attributes": "4.1.2",
"mjml-head-breakpoint": "4.1.2",
"mjml-head-font": "4.1.2",
"mjml-head-preview": "4.1.2",
"mjml-head-style": "4.1.2",
"mjml-head-title": "4.1.2",
"mjml-hero": "4.1.2",
"mjml-image": "4.1.2",
"mjml-migrate": "4.1.2",
"mjml-navbar": "4.1.2",
"mjml-raw": "4.1.2",
"mjml-section": "4.1.2",
"mjml-social": "4.1.2",
"mjml-spacer": "4.1.2",
"mjml-table": "4.1.2",
"mjml-parser-xml": "4.1.2",
"mjml-text": "4.1.2",
"mjml-validator": "4.1.2",
"mjml-wrapper": "4.1.2"
}
}
$ grep -A1 mjml yarn.lock | grep -B1 'version "4.2.1"'
mjml-accordion@^4.1.2:

version "4.2.1"

mjml-body@^4.1.2:

version "4.2.1"

mjml-button@^4.1.2:

version "4.2.1"

mjml-carousel@^4.1.2:

version "4.2.1"

mjml-cli@^4.1.2:

version "4.2.1"

mjml-column@^4.1.2:

version "4.2.1"

mjml-core@^4.1.2, mjml-core@^4.2.1:

version "4.2.1"

mjml-divider@^4.1.2:

version "4.2.1"

mjml-group@^4.1.2:

version "4.2.1"

mjml-head-attributes@^4.1.2:

version "4.2.1"

mjml-head-breakpoint@^4.1.2:

version "4.2.1"

mjml-head-font@^4.1.2:

version "4.2.1"

mjml-head-preview@^4.1.2:

version "4.2.1"

mjml-head-style@^4.1.2:

version "4.2.1"

mjml-head-title@^4.1.2:

version "4.2.1"

mjml-head@^4.1.2:

version "4.2.1"

mjml-hero@^4.1.2:

version "4.2.1"

mjml-image@^4.1.2:

version "4.2.1"

mjml-migrate@^4.1.2, mjml-migrate@^4.2.1:

version "4.2.1"

mjml-navbar@^4.1.2:

version "4.2.1"

mjml-parser-xml@^4.1.2, mjml-parser-xml@^4.2.1:

version "4.2.1"

mjml-raw@^4.1.2:

version "4.2.1"

mjml-section@^4.1.2, mjml-section@^4.2.1:

version "4.2.1"

mjml-social@^4.1.2:

version "4.2.1"

mjml-spacer@^4.1.2:

version "4.2.1"

mjml-table@^4.1.2:

version "4.2.1"

mjml-text@^4.1.2:

version "4.2.1"

mjml-validator@^4.1.2, mjml-validator@^4.2.1:

version "4.2.1"

mjml-wrapper@^4.1.2:
version "4.2.1"


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mjmlio/mjml/issues/1442#issuecomment-443464798, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAizzby3fJ3DbebpDUKsXpOs5AV5PqZzks5u0wdPgaJpZM4Y4DPX
.

--
Cordialement,
Maxime BRAZEILLES

For what its worth. This was what I was able to get working on our servers.

I was lucky enough to have captured a package-lock.json file of the previous version. I noticed depending on the version of npm you will get different results. The node npm versions on AWS AMI for Rails are very old. The default npm was ignoring the package-lock all together. Locally, I could get the correct version installed using the package-lock.json file. I updated the node and npm versions by installing nvm. I used node 10.8 and npm 6.4.1. That allowed me to install the minimal needs of mjml-rails within the app directory, node_modules. mjml-rails uses npm bin which searches for the binary in rails root first.

I don't think this is the best solution but it worked in this case. May not help for you @aeris, especially if you don't have a package-lock file.

Thanks @iRyusa for pointing in the right direction. 🙏

I just realized all my MJML emails are rendering blank. Trying to follow the right steps in my Rails app to get this working again, but not sure based on the discussion going on.

Edit: I just upgraded from node 10.9.0 and npm 6.2.0 to node 11.1.0 and npm 6.4.0, which when I pushed to production is what appears to have left my emails rendering blank. I am going to try rolling back node to see if I can get a different result.

So I was able to get things rendering again by reverting to node 10 via brew install node@10 and reverting to a previous yarn.lock file by downloading a ZIP of my repo prior to the last commit before the upgrade that broke this. The minute I do a yarn upgrade it breaks again even with node 10.

Turns out I had some old MJML 3 syntax and some other layout issues, but these were not revealed until I hit MJML 4.2.1. All fixed now.

Hi @memoht @bluengreen and @aeris , internal mjml dependencies are now pinned in the new 4.3 release, feel free to try it out !

Was this page helpful?
0 / 5 - 0 ratings