twigkit/semantic.gs — Issue #39: a.extract[1] @import error with LESS-1.2.0.min.js
Author: kotan
Created: 2012-01-16 11:44:14+00:00
State: open

This concerns an error calling this line of code in style.less with LESS v1.2.0

@import "grid.less";

...which returns an error saying "a.extract[1] undefined"

I didn't forget to call less.js from a folder in the template folder nor did I forget to indicate the proper path for the .less files. I used a code via perkins theme's functions.php which goes:

---
/*START*/
define('WP_DEBUG', true);
require 'class.wp-less-styles.php';
include 'functions.less-styles.php';

class CallLessCSS
{
public function init()
{
// Register less
wp_register_script('less', get_template_directory_uri() . '/js/less-1.2.0.min.js', array(), false, true);
// Then add to the queue
wp_enqueue_script('less');

// Register app.less
wp_register_less_style('app', get_template_directory_uri() . '/stylesheet/style.less');
// Then add to the queue
wp_enqueue_less_style('app');

// Register ubuntu font
wp_register_style('ubuntu-font', 'http://fonts.googleapis.com/css?family=Ubuntu');
wp_enqueue_style('ubuntu-font');
}
}

// Init
add_action('init', array('CallLessCSS', 'init'));
/*END*/
---

I didn't forget to include perkinstheme's class.wp-less-styles.php and include 'functions.less-styles.php in the template folder.

I tried calling the files before the

tag manually but it still does the same thing.

And I make sure to check on the error page's source to make sure I called the files properly.

I tried using less-1.1.3.min.js instead the problem didn't occur.

If it helps, I saw this in github as well: https://github.com/cloudhead/less.js/issues/563 re: import bug on v2.0. They claim 1.2.1 works but LESSCSS.org has yet to release that as of time of this posting.

For now, I'll go for 1.1.3

Hope that helps :)