-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
Description
I am trying to use Less in a programmatic fashion inside node, but I get this error:
import less from 'less'
let lessRender = less.render;
// then I call lessRender on something
let y = lessRender(`
body {
a: 1;
b: 2;
c: 30;
d: 4;
}`, {sourceMap: {}}, function(error, output) {return output})
TypeError: Cannot read property 'options' of undefined
what am I doing wrong? The documentation is vaguely written, and there is no tutorial on how to import the library and its functions. It also says API coming soon!
http://lesscss.org/usage/#programmatic-usage
Also, a couple of links don't work for example: https://github.com/less/less.js/blob/master/lib/less/environment/environment-api.js
Note: the code is written for less 2 inside Node, and I am trying to update it.