baldwin-agency / magento2-module-less-js-compiler

Allows Magento 2 to compile less files using the less nodejs compiler
MIT License
23 stars 4 forks source link

Prepend the lessc call with an explicit call to the nodejs binary with the '--no-deprecation' flag #2

Closed hostep closed 6 years ago

hostep commented 6 years ago

Discovered on a server with these versions:

When executing the lessc binary on this server and then writing the output to a css file, the css files can contain invalid css because node is complaining about deprecated modules in use. This then makes the css file incorrect and the browser is not able to parse parts of the css file because of this. For example, the css file can have this string as the first line: (node:87545) fs:re-evaluating native module sources is not supported. If you are using the graceful-fs module,please update it to a more recent version.

Currently solved by explicitly calling the nodejs binary with the flag --no-deprecation.

Will keep this PR open for a few days until I've experimented with this change on a couple of other servers to make sure this keeps working correctly on different versions of npm & nodejs.