We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Minify assets error

Hi guys,

Im having a problem in minifying my js assests, Im using Phalcon 1.3.4. Here is the error

Phalcon\Assets\Exception: Non-free jsminifier not available

Here is my code

<?php

use \Phalcon\Mvc\Controller as Controller,
    \Phalcon\Tag,
    \Phalcon\Mvc\Dispatcher,
    \Phalcon\Http\Request,
    \Phalcon\Assets\Manager;

class BaseController extends Controller
{
    public function initialize()
    {
        /* 
            set default title on every page of the site 
        */
        Tag::prependTitle('Test Page | ');

        /* 
            set assets on head tag 
        */
        $this   ->assets
                ->collection('header_assets')
                ->addCss('css/bootstrap.min.css')
                ->addCss('css/font-awesome.min.css')
                ->addCss('css/normalize.min.css')
                ->addCss('css/style.css');
        /* 
            set assets before body closing tag 
        */
        $this   ->assets
                ->collection('footer_assets')
                ->setTargetPath('js/final.js')
                ->setTargetUri('js/final.js')
                ->addJs('js/jquery-1.11.1.min.js')
                ->addJs('js/modernizr.min.js')
                ->addJs('js/bootstrap.min.js')
                ->addJs('js/style.js')
                ->join(true)
                ->addFilter(new Phalcon\Assets\Filters\Jsmin());
    }
}

Hi, you have compiled phalcon with the option excluding jsmin and cssmin which have "non free" licences.

Please compile with --without-non-free = false