Crunch / postcss-less

MIT License
35 stars 9 forks source link

CssSyntaxError: postcss-less-engine: <css input>: Right-hand side of 'instanceof' is not an object #17

Open Banzerczhs opened 4 years ago

Banzerczhs commented 4 years ago

I ran this repository with the following example and got this error description

The following code just changes the file name

//js

var postcss=require('postcss');
var less = require('postcss-less-engine');
var autoprefixer = require('autoprefixer');
const fs=require('fs');
const path=require('path');

var exampleLess = fs.readFileSync(path.join(__dirname, './aaa.less'), 'utf8');

postcss([
    less({ strictMath: true }), 
    autoprefixer()
  ])
  .process(exampleLess, { parser: less.parser, from: 'aaa.less' })
  .then(function (result) {
    console.log(result.css);
  }, function(err) {
      console.log(err);
});

//aaa.less

.app{
    color: #fff;
    .le{
        font-size: 24px;
        color: #3756;
    }
}
sxlleo commented 4 years ago

I have the same question.

zzuu666 commented 4 years ago

I got the same issue, but it works with less 2.7.x 🤷‍♂️