Less compiler not behaving

Good afternoon,

I’m developing my website and everything was working find but all of a sudden the less compiler stopped working. I have these installed

lessPHP
PHPthumbOf
LessCSS
pdoTools

I can’t find out why it is not compiling properly or how to better identify where the issue is originating from. It may be something simple as I’ve never played much with PHP and modX. I only see one error in the Error Report and it is also related to php (my Y needs to be in quotes and yet I can’t edit it)

Thank you in advance

Not familiar with the compiler in MODX. I use a local compiler called Koala, maybe of use…

1 Like

I’ve never used a Less compiler inside MODX, but can you post the error from your log? Maybe that’ll point to something that might help figure it out.

1 Like

The only message that shows up in the error report is this

[2019-04-30 14:54:33] (ERROR @ /home/cr39jchgg9bk/public_html/core/cache/includes/elements/modsnippet/49.include.cache.php : 3) PHP warning: Use of undefined constant Y - assumed ‘Y’ (this will throw an Error in a future version of PHP)

Now, I’ve gone in to try and edit that file but it seems to be pulling from elsewhere, and I think that only has to do with the copyright in the footer. I go in to add single quotes to the ‘Y’ but it doesn’t keep my changes unfortunately. All my packages are updated and my site doesn’t seem to have any actual php files outside of those in the cache, and those get replaced constantly

The number in that cache file (49) refers to the ID of the snippet. You can find the snippets in the manager in the Elements tab. Editing the snippet will make sure future cache files use the correct too.

You’re right though, that doesn’t seem like it’s related to the Less stuff. Not sure what that could be, sorry.

1 Like

Yeah, I’m going through and correcting errors and anything I can to identify the problem.

Thus far I’ve reinstalled my compilers and nothing changed. There’s no errors in the report or in the element inspector so I don’t have many trails to follow. Will update this post once it gets sorted

I found a solution. Maybe not the best solution, but I did find A solution. The only things I could think of to do were to use websites like lesstester.com to check my code and same thing with css. After correcting that nothing really changed, but clean code is always good. I looked at the Element Inspector and found two warnings - one stating that plugins.js was MIME typed wrong (it was a <link> instead of <script>. I was also MIME typed on my _styles.less <link> which is where all my code goes to.I looked into fixing these things cause I ran out of ideas and might as well fix any errors.

SO WHAT DID YOU DO?

I checked my header to make sure \scripts> and <links> were done correctly, and I downloaded and installed less.js. Download less.js, install it, and upload less.js to your site. Link to less.js in the head AFTER you call your .less files

Instructions for Less (with links)
http://lesscss.org/usage/

Thanks for posting.

I guess you wont have to use the extra then. From a performance point of view, I would pre-process the less with an processor like Koala and not live.

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.