cloudhead/less.js — Issue #627: js error when loading cached imports
Author: sanderkruger
Created: 2012-02-09 10:11:04+00:00
State: open

In version 1.2.1 of less, an error occurs when loading imported stylesheets and they are cached.

On line 3083, the following call:
callback(null, sheet, { local: true, remaining: remaining });

uses the wrong arguments for the callback function, which expects the arguments e, root, _, sheet, env (anonymous function defined on lines 3018 - 3028. This function checks:

if (env.local) {
log("loading " + sheet.href + " from cache.");

since env is undefined, the js interpreter throws an error. It doesn't seem to be problematic for the rest of the script, but it's rather annoying to have firebug throw an error each time this happens.

A fix is to change 3083 to:
callback(null, null, data, sheet, { local: true, remaining: remaining });