Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap 3 fails to compile #432

Closed
aristath opened this issue Jun 3, 2013 · 64 comments
Closed

Bootstrap 3 fails to compile #432

aristath opened this issue Jun 3, 2013 · 64 comments

Comments

@aristath
Copy link

aristath commented Jun 3, 2013

Bootstrap 3 broke on this commit: twbs/bootstrap@60575df#diff-3
The problem is on line 253 of the mixins.less file there, but I can't figure out what it is..

@krnlde
Copy link

krnlde commented Jun 5, 2013

It's the parameter list of the gradients mixins, because they are now separated with semicolons instead of commas.
I don't know why, but it seems that you now have the ability to omit parameters in the middle. (similar to messages in Obj-C)

@krnlde
Copy link

krnlde commented Jun 5, 2013

Got it. http://lesscss.org/#-parametric-mixins says:
Mixins With Multiple Parameters

Parameters are either semicolon or comma separated. It is recommended to use semicolon. The symbol comma has double meaning: it can be interpreted either as a mixin parameters separator or css list separator.

Using comma as mixin separator makes it impossible to create comma separated lists as an argument. On the other hand, if the compiler sees at least one semicolon inside mixin call or declaration, it assumes that arguments are separated by semicolons and all commas belong to css lists:

Maybe the solution is in the $delim variable in here: https://github.com/leafo/lessphp/blob/master/lessc.inc.php#L2811

@krnlde
Copy link

krnlde commented Jun 5, 2013

...and further information regarding "named parameters", which might not be implemented in lessphp atm: less/less.js#268

@aristath
Copy link
Author

aristath commented Jun 5, 2013

@krnlde yeah, you're right...
I just came to the same conclusion.
Can you think of any workaround for this?
I'm considering altering the mixins.less file for my application...

@krnlde
Copy link

krnlde commented Jun 5, 2013

You would have to alter the implementation of the mixins aswell. For example in the https://github.com/twitter/bootstrap/blob/3.0.0-wip/less/dropdowns.less#L71. No solution for the future.

The lessphp compiler has to work the same as the less.js.

@aristath
Copy link
Author

aristath commented Jun 5, 2013

In case anyone's interested, I decided to fork Bootstrap and keep a lessphp-compatible version.
The above problem can be solved with this commit: https://github.com/aristath/bootstrap/commit/9b53072ddf77fa49013f4006fcd75a4857103753

@krnlde
Copy link

krnlde commented Jun 6, 2013

Thank you! Unfortunately this isn't the right move. The improvements in less.js absolutely make sense. And all further releases of Bootstrap will rely on them. Therefore lessphp should support them in longterm.

But for now I appreciate your fork very much :)

@aristath
Copy link
Author

aristath commented Jun 6, 2013

Yes, I agree. They do make sense and they do make writing less easier!
But I just can't wait for lessphp to be updated as this might take months and I need it now!
lessphp should support everything that less.js supports but that's not an easy task and while I try to understand how to update lessphp to support these and contribute back here, this fork will at least prevent my app from crashing. :)

@krnlde
Copy link

krnlde commented Jun 6, 2013

👍

@GodOfGrandeur
Copy link

I have a issue with Bootstrap 3 too. It falls into a infinite loop and can't compile it. Error is in: lessc.inc.php on line 1252.

@aristath
Copy link
Author

aristath commented Jun 7, 2013

Hello there @jaggi
Until lessphp is updated to support all the new features of less.js that were introduced in version 1.4 you 're free to use my mofied version of Bootstrap3 that compiles with phpless without any issues: https://github.com/aristath/bootstrap
I'll maintain it an update it on a daily basis as I need it for my app so it will always be in sync with bootstrap's changes.

@GodOfGrandeur
Copy link

@aristath thanks for the offer but for the time being I've changed to using recess which has a watch function so compiles each time I make changes. It allows me to get around any of the current issues until lessphp is updated.

@dwightwatson
Copy link

Is lessphp still in development; are we likely to see the changes required for Bootstrap 3 to be made?

@aristath
Copy link
Author

@dwightwatson as mentioned above, feel free to use my branch of Bootstrap 3.0 until lessphp gets updated.
It's compatible and I had no issues using it so far.
I keep updating it daily, pulling commits from the official repo and checking for any incompatibilities.

@dwightwatson
Copy link

I understand, and I appreciate the offer. I might do that in the meantime for development, but am concerned about relying on lessphp for the future of my projects if it is no longer being developed/maintained.

@aristath
Copy link
Author

As far as I know this prohect is properly maintained.
However less.js got updated recently and some of its improvements need a lot of work to get implemented in lessphp.
It might take some time, but it will happen. :)

@sergiodlopes
Copy link

@aristath still having the same issues with your fork in lessphp (reaching maximum function nesting level). Thanks for all the work thought :)

Can someone send me a compiled (css) version of bootstrap 3?

@aristath
Copy link
Author

@sergiodlopes
Copy link

@aristath Thanks! :)

@mapb1990
Copy link

+1

@solispauwels
Copy link

HELP!

@ursbraem
Copy link

ursbraem commented Aug 2, 2013

yelp

@kieste
Copy link

kieste commented Aug 2, 2013

+1 please fix it soon. THANX!!!

@bjorn-ali-goransson
Copy link

in lessc.inc.php:2793 (inside function argumentValues), you can change the following:

if (!$this->literal($delim)) break;

to

if (!$this->literal($delim) && !$this->literal(";")) break;

and you can now call mixins with either comma or semicolon. Ugly but what're we going to do.

But now there is another problem; named parameters like:

#gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));

(dropdowns.less:76)

@mrded
Copy link

mrded commented Aug 5, 2013

You can change less files, like follow.

.vertical(@start-color: #555; @start-percent: 0%; @end-color: #333; @end-percent: 100%) {}
to
.vertical(@start-color: #555, @start-percent: 0%, @end-color: #333, @end-percent: 100%) {}


#gradient > .vertical(@start-color: @dropdown-link-hover-bg; @end-color: darken(@dropdown-link-hover-bg, 5%));
to
#gradient > .vertical(@dropdown-link-hover-bg,, darken(@dropdown-link-hover-bg, 5%));

@leafo
Copy link
Owner

leafo commented Aug 5, 2013

It's coming, just gonna take me some time because lessphp is quite behind.

@solispauwels
Copy link

master

@petercoles
Copy link

This 6-line project works fine for me.

composer.json

{
    "require": {
        "twitter/bootstrap": "dev-3.0.0-wip",
        "leafo/lessphp": "0.3.*@dev"
    }
}

index.php

<?php
require 'vendor/autoload.php';
$less = new lessc;
echo $less->compileFile("vendor/twitter/bootstrap/less/bootstrap.less");

I'd check that there's not something else in your environment getting in the way

@swiftdv8
Copy link

UPDATE: Twitter bootstrap 3 no longer works if pulling master. The last working commit is 727a91de1c. So pull that commit for the time being to get it playing nice with lessphp. The breaking commit appears to be this one... 265fda7903 - hopefully mr leafo will have some ideas.

For anyone unsure how to get to that commit just clone bootstrap as normal and then create a branch from that commit:

git checkout -b working_lessphp 727a91de1c

@andrewdelprete
Copy link

I am also having problems with Bootstrap 3.0 release. I'm using Composer to install Lessphp and Bootstrap, would anyone know how I can pull from a commit that works via Composer?

@petercoles
Copy link

"leafo/lessphp": "0.4.0"

@swiftdv8
Copy link

@Pathsofdesign

Peters right that you need the 4.0 release of lessphp but you will also need lock to the last working commit on bootstrap, something like this might work:

"require": {
"leafo/lessphp": "0.4.0",
"twitter/bootstrap": "dev-master#727a91de1c"
},

I dont use composer to install bootstrap and packagist seems to reference a different branch for composer install so Im not 100% on this.

@petercoles
Copy link

I may have interpreted @Pathsofdesign's reference to Bootstrap 3.0 a little too literally (i.e. to mean the 3.0.0 stable release).

However, for the benefit of anybody wanting to get as closer to the dev-master as possible, @dwall80's suggestion works.

@andrewdelprete
Copy link

@petercoles no problem, I wasn't real clear with my comment.

After utilizing Bootstrap's commit #727a91de1c and LessPHP 0.4.0, I started receiving this error on compile:

".pull-right is undefined: line: 60"

I had to roll with an earlier commit of LessPHP and Bootstrap to work via Composer.

"leafo/lessphp": "dev-master#85bd4557920d5f4fcbf41beb621e91b842e3621b",
"twitter/bootstrap": "dev-master#727a91de1c"

Solution found here: http://stackoverflow.com/questions/19059069/asseticdump-fails-with-pull-right-is-undefined-line-60/19061496#19061496

@petercoles
Copy link

That's strange as

"require": {
    "leafo/lessphp": "0.4.0",
    "twitter/bootstrap": "dev-master#727a91de1c"
}

and

"require": {
    "leafo/lessphp": "0.4.*@dev",
    "twitter/bootstrap": "dev-master#727a91de1c"
}

work fine for me.

@swiftdv8
Copy link

@petercoles,"leafo/lessphp": "0.4.0" worked for me too when using plessc to compile from the command line but I got the same error as Pathsofdesign when trying to compile via basset (laravel asset manager package) - not sure if this is significant.
Using the two commits mentioned it all works fine through either.

@tomsarduy
Copy link

New: lessphp 0.4.0, compiles Bootstrap 3!!! see Changelog Thanks! :)

@swiftdv8
Copy link

@tomsrduy Have you tried it? Because it said it did previously but at as written in the comments it doesn't compile past a certain breaking commit even with the latest release of lessphp.

@krnlde
Copy link

krnlde commented Oct 25, 2013

Doesn't work for me @tomsarduy. Working with twbs/bootstrap@a58c83a (currently latest)

It now sais: Failed to assign arg @list

@pdias
Copy link

pdias commented Oct 27, 2013

Hello,

I have comment the:

Failed to assign arg @list

in #491

My solution (not a solution), just for work, was comment the throw.

Thanks.

@ghost
Copy link

ghost commented Nov 3, 2013

Just comment the line brings another error:

Fatal error: Uncaught exception 'Exception' with message '.make-grid is undefined: path/less/bootstrap.less on line 50' in path/php/lessc.inc.php:3521

Stack trace:
0 path/php/lessc.inc.php(2063): lessc_parser->throwError('.make-grid is u...', 17931)
1 path/php/lessc.inc.php(720): lessc->throwError('.make-grid is u...')
2 path/php/lessc.inc.php(757): lessc->compileProp(Array, Object(stdClass), Object(stdClass))
3 path/php/lessc.inc.php(757): lessc->compileProp(Array, Object(stdClass), Object(stdClass))
4 path/php/lessc.inc.php(757 in path/php/lessc.inc.php on line 3521

@pdias
Copy link

pdias commented Nov 4, 2013

Hello,

I use this in composer for leafo :

"leafo/lessphp": "dev-master#85bd4557920d5f4fcbf41beb621e91b842e3621b",

And just comment line 617 in lessc.inc.php works.

@nickrouty
Copy link

The following currently is working for me thanks to @dwall80

"require": {
        "leafo/lessphp": "0.4.0",
        "twitter/bootstrap": "dev-master#727a91de1c"
}

@maubut
Copy link

maubut commented Nov 18, 2013

lessPHP failed to compile v3.0.2. Seem to be in grid.less..

@mbrevda
Copy link

mbrevda commented Nov 19, 2013

+1

@sstok
Copy link

sstok commented Nov 22, 2013

Seems to be caused by.
twbs/bootstrap@c814ad1#diff-5

This is the only file having @list

Full stack trace.

() at [...]/vendor/leafo/lessphp/lessc.inc.php:3462
lessc_parser->throwError() at [...]/vendor/leafo/lessphp/lessc.inc.php:2005
lessc->throwError() at [...]/vendor/leafo/lessphp/lessc.inc.php:617
lessc->zipSetArgs() at [...]/vendor/leafo/lessphp/lessc.inc.php:470
lessc->patternMatch() at [...]/vendor/leafo/lessphp/lessc.inc.php:553
lessc->patternMatchAll() at [...]/vendor/leafo/lessphp/lessc.inc.php:572
lessc->findBlocks() at [...]/vendor/leafo/lessphp/lessc.inc.php:684
lessc->compileProp() at [...]/vendor/leafo/lessphp/lessc.inc.php:725
lessc->compileProp() at [...]/vendor/leafo/lessphp/lessc.inc.php:162
lessc->compileImportedProps() at [...]/vendor/leafo/lessphp/lessc.inc.php:769
lessc->compileProp() at [...]/vendor/leafo/lessphp/lessc.inc.php:162
lessc->compileImportedProps() at [...]/vendor/leafo/lessphp/lessc.inc.php:769
lessc->compileProp() at [...]/vendor/leafo/lessphp/lessc.inc.php:284
lessc->compileProps() at [...]/vendor/leafo/lessphp/lessc.inc.php:278
lessc->compileRoot() at [...]/vendor/leafo/lessphp/lessc.inc.php:193
lessc->compileBlock() at [...]/vendor/leafo/lessphp/lessc.inc.php:1807
lessc->compile() at [...]/vendor/leafo/lessphp/lessc.inc.php:1934

@krnlde
Copy link

krnlde commented Dec 5, 2013

FYI https://github.com/cbekir/lessphp compiles the latest bootstrap dist.

@afurculita
Copy link

@krnlde it compiles, but with errors. For example, the widths for all the columns are not calculated.

@krnlde
Copy link

krnlde commented Dec 14, 2013

Oh OK! Thanks

@nusphere
Copy link

@krnlde thx to your fork
a working solution is to add the fork as repository

"repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:cbekir/lessphp.git"
        }
    ],

"require": {

        "twbs/bootstrap": "3.0.*",
        "leafo/lessphp": "dev-master"
    },

@krnlde
Copy link

krnlde commented Dec 18, 2013

Doesn't it have to be

...
"cbekir/lessphp": "dev-master"
...

@hice3000
Copy link

@krnlde I don't think so as the composer.json's name tag is leafo/lessphp, too.

@aristath
Copy link
Author

Closing this one.
It's been too long and to be honest I haven't checked it recently.
For all I know this may be working now... if needed I guess we can open up a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests