Question

I was trying to install the glyphicons locally rather than pulling from the CDN (which had stopped displaying them, for reasons I didn't investigate). Now running assetic:dump results in an exception I have no idea how to fix:

me@server:/var/www/blah$ php app/console assetic:dump -vvv
Dumping all dev assets.
Debug mode is on.

20:26:32 [file+] /var/www/blah/app/../web/fonts/glyphicons-halflings-regular.eot
        /var/www/blah/app/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.eot
20:26:32 [file+] /var/www/blah/app/../web/fonts/glyphicons-halflings-regular_glyphicons-halflings-regular_1.eot
        /var/www/blah/app/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.eot
20:26:32 [file+] /var/www/blah/app/../web/fonts/glyphicons-halflings-regular.svg
        /var/www/blah/app/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.svg
20:26:32 [file+] /var/www/blah/app/../web/fonts/glyphicons-halflings-regular_glyphicons-halflings-regular_1.svg
        /var/www/blah/app/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.svg
20:26:32 [file+] /var/www/blah/app/../web/fonts/glyphicons-halflings-regular.ttf
        /var/www/blah/app/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.ttf
20:26:32 [file+] /var/www/blah/app/../web/fonts/glyphicons-halflings-regular_glyphicons-halflings-regular_1.ttf
        /var/www/blah/app/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.ttf
20:26:32 [file+] /var/www/blah/app/../web/fonts/glyphicons-halflings-regular.woff
        /var/www/blah/app/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.woff
20:26:32 [file+] /var/www/blah/app/../web/fonts/glyphicons-halflings-regular_glyphicons-halflings-regular_1.woff
        /var/www/blah/app/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.woff
20:26:32 [file+] /var/www/blah/app/../web/css/bootstrap.css
        /var/www/blah/app/../vendor/twbs/bootstrap/less/bootstrap.less

  [Exception]
  .pull-right is undefined: line: 60

Exception trace:
 () at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:3465
 lessc_parser->throwError() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:2008
 lessc->throwError() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:685
 lessc->compileProp() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:282
 lessc->compileProps() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:220
 lessc->compileCSSBlock() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:194
 lessc->compileBlock() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:656
 lessc->compileProp() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:282
 lessc->compileProps() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:220
 lessc->compileCSSBlock() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:194
 lessc->compileBlock() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:656
 lessc->compileProp() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:282
 lessc->compileProps() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:235
 lessc->compileMedia() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:197
 lessc->compileBlock() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:656
 lessc->compileProp() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:160
 lessc->compileImportedProps() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:766
 lessc->compileProp() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:282
 lessc->compileProps() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:276
 lessc->compileRoot() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:191
 lessc->compileBlock() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:1810
 lessc->compile() at /var/www/blah/vendor/leafo/lessphp/lessc.inc.php:1937
 lessc->parse() at /var/www/blah/vendor/kriswallsmith/assetic/src/Assetic/Filter/LessphpFilter.php:104
 Assetic\Filter\LessphpFilter->filterLoad() at /var/www/blah/vendor/kriswallsmith/assetic/src/Assetic/Filter/FilterCollection.php:62
 Assetic\Filter\FilterCollection->filterLoad() at /var/www/blah/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php:90
 Assetic\Asset\BaseAsset->doLoad() at /var/www/blah/vendor/kriswallsmith/assetic/src/Assetic/Asset/FileAsset.php:65
 Assetic\Asset\FileAsset->load() at /var/www/blah/vendor/kriswallsmith/assetic/src/Assetic/Asset/BaseAsset.php:99
 Assetic\Asset\BaseAsset->dump() at /var/www/blah/vendor/kriswallsmith/assetic/src/Assetic/Asset/AssetCollection.php:151
 Assetic\Asset\AssetCollection->dump() at /var/www/blah/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php:222
 Symfony\Bundle\AsseticBundle\Command\DumpCommand->doDump() at /var/www/blah/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php:162
 Symfony\Bundle\AsseticBundle\Command\DumpCommand->dumpAsset() at /var/www/blah/vendor/symfony/assetic-bundle/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php:61
 Symfony\Bundle\AsseticBundle\Command\DumpCommand->execute() at /var/www/blah/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:244
 Symfony\Component\Console\Command\Command->run() at /var/www/blah/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:904
 Symfony\Component\Console\Application->doRunCommand() at /var/www/blah/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:191
 Symfony\Component\Console\Application->doRun() at /var/www/blah/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96
 Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/blah/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:121
 Symfony\Component\Console\Application->run() at /var/www/blah/app/console:27

assetic:dump [--watch] [--force] [--period="..."] [write_to]

config.yml includes:

assetic:
    debug:          %kernel.debug%
    use_controller: false
    filters:
        cssrewrite: ~

        lessphp:
            apply_to: "\.less$"
            file:     "%kernel.root_dir%/../vendor/leafo/lessphp/lessc.inc.php"
    assets:
        fonts_glyphicons_eot:
            inputs:
                - "%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.eot"
            output: "fonts/glyphicons-halflings-regular.eot"
        fonts_glyphicons_svg:
            inputs:
                - "%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.svg"
            output: "fonts/glyphicons-halflings-regular.svg"
        fonts_glyphicons_ttf:
            inputs:
                - "%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.ttf"
            output: "fonts/glyphicons-halflings-regular.ttf"
        fonts_glyphicons_woff:
            inputs:
                - "%kernel.root_dir%/../vendor/twbs/bootstrap/fonts/glyphicons-halflings-regular.woff"
            output: "fonts/glyphicons-halflings-regular.woff"
        css_bootstrap:
            inputs:
                -  "%kernel.root_dir%/../vendor/twbs/bootstrap/less/bootstrap.less"
            output: "css/bootstrap.css"
            filters:
                - lessphp
        js_bootstrap:
            inputs:
                -  "%kernel.root_dir%/../vendor/twbs/bootstrap/js/*.js"
            output: "js/bootstrap.js"

composer.json includes:

"require": {
    "twbs/bootstrap": "v3.0.0",
    "components/jquery": "1.10.2",
    "leafo/lessphp": "0.4.*@dev",
}

Any advice is greatly appreciated!

Was it helpful?

Solution

Turns out it's a bug in lessphp: https://github.com/leafo/lessphp/pull/478

Currently the solution is change the version in composer.json to:

"require": {
    "leafo/lessphp": "dev-master#85bd4557920d5f4fcbf41beb621e91b842e3621b"
}

but obviously this is just temporary. Thanks to milka in #symfony on freenode!

OTHER TIPS

Checkout this reported bug on github. It looks like compressed files with a missing ; at the end are causing this behaviour. One solution would be to add it manually.

The suggested solution from me is to use uncompressed files to prevent this and also have more readable code in your dev environment. For the prod environment the files will be compressed by assetic anyway.

I'm pretty sure that I ran into this issue and determine that it was because of the Bootstrap LESS has variables defined in separate files and the Assetic LESS compiler doesn't play well with variables defined in a different file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top