Closed foinf closed 4 months ago
That looks like a bug, yes.
But also, wikimedia/less.php
's code on GitHub is return new self( $val, $this->currentFileInfo, true );
which should work ok, so are you somehow using an old version of the library? If you update you can get past this bug without waiting on me.
That looks like a bug, yes.
But also,
wikimedia/less.php
's code on GitHub isreturn new self( $val, $this->currentFileInfo, true );
which should work ok, so are you somehow using an old version of the library? If you update you can get past this bug without waiting on me.
Hi, thanks for response! Yes, I did figure out I was using an older version (as it was a dependency of an outdated package) however, I have run into yet another problem which I can confirm is caused by strauss.
If I use the 4.2.1 version of less.php, it generates the styles just fine.
But if I run strauss on it and then use the prefixed package, this is what happens:
Warning: foreach() argument must be of type array|object, null given in <path>\mamp_docs\less_test\vendor-prefixed\wikimedia\less.php\lib\Less\Tree\Ruleset.php on line 426
The above error multiple times with the result being:
{display:none !important}/* :root { --swiper-navigation-color: #c09e79; --a:blue; } */{box-sizing:border-box}{text-decoration:none}{margin:0}{text-decoration:none}{display:grid;grid-template-rows:1fr auto}{height:100%}{min-height:100%}{width:100%;/*overflow-x: hidden;*/}{text-transform:lowercase}
As you can see, the output has no selectors in it, just the rules. This is happening on the dev server (unix) I am working on as well as a minimalist example I created on MAMP on windows to test.
The real problem initially was that the class name is Less_Tree_Url
and the return type was new Less_Tree_URL
, so that's not a bug here but a bug in the library which has been fixed.
I can't quite see if the second issue is related to this library. That error message is saying $this->paths
is null (public $paths
). Can you give me step by step instructions and output of the library working before running Strauss and then the buggy behaviour after?
Hi,
Yes, I can share the results with you when I am on my computer. But, I think you're correct that it's not really a strauss issue because if that were true, then the timber/timber package as well as the scssphp/scssphp package (switched to the latter after wasting a lot of time on the less.php one) should have caused errors as well but both these packages work fine.
So, if you think that the bug label is incorrect, this thread can be moved/closed/relabeled as you see fit.
However, I will share the results of less.php output for both prefixed as well as unprefixed files ASAP.
Thanks!
For example (scroll to the return statement at the end of the class definition):
In the last line, the compile function is (I assume) returning the instance of the class but this causes a fatal error because Class 'Less_Tree_URL' is not found:
Fatal error: Uncaught Error: Class 'Less_Tree_URL' not found in /<path>/staging_html/wp-content/themes/<theme>/vendor-prefixed/wikimedia/less.php/lib/Less/Tree/Url.php:77
I used strauss.phar and the only config I supplied was the following:
Another library Timber/Timber which was in the same vendor directory works fine. Is there anything I am missing or any step I didn't take?
Thanks!