sindresorhus / gulp-autoprefixer

Prefix CSS
MIT License
694 stars 50 forks source link

Bug with Autoprefixer : Error! no writecb in Transform class #51

Closed Scriptura closed 8 years ago

Scriptura commented 8 years ago

Hello,

I am writing to report a bug :

Error! no writecb in Transform class

Possibly related with Stylus for Gulp ?

I compile errors with the new version of Autoprefixer (3.1.0). I downgraded to a previous version and it works again (2.3.1).

The package.json (stable):

"dependencies": {
    "gulp": "^3.9.0"
  },
"devDependencies": {
  "gulp-autoprefixer": "^2.3.1",
  "gulp-concat": "^2.6.0",
  "gulp-connect": "^2.2.0",
  "gulp-header": "^1.7.1",
  "gulp-iconfont": "^5.0.0",
  "gulp-imagemin": "^2.4.0",
  "gulp-jade": "^1.1.0",
  "gulp-jshint": "^1.11.2",
  "gulp-markdown": "^1.2.0",
  "gulp-plumber": "^1.0.1",
  "gulp-rename": "^1.2.2",
  "gulp-replace": "^0.5.4",
  "gulp-ruby-sass": "^1.1.0",
  "gulp-sass": "^2.0.4",
  "gulp-smushit": "0.0.4",
  "gulp-sourcemaps": "^1.6.0",
  "gulp-stylus": "^2.1.0",
  "gulp-sync": "^0.1.4",
  "gulp-uglify": "^1.5.1",
  "gulp-util": "^3.0.7",
  "vinyl-ftp": "^0.4.5"
}

The Sass and Libsass plugins are loaded, but I use Stylus for compiling linked to Autoprefixer.

The Gulpfile.js (Entire file) :

var autoprefixerOptions = { browsers: ['last 2 versions', '> 5%'] };

gulp.task('styles', function() {
  return gulp
    .src(inputStyles)
    .pipe(plumber())
    .pipe(sourcemaps.init())
    .pipe(stylus({
        compress: true,
        linenos: false
    }))
    .on('error', function(err) {
        console.error('Error!', err.message);
    })
    .pipe(autoprefixer(autoprefixerOptions))
    .pipe(sourcemaps.write('../Styles/Maps', {addComment: true}))
    .pipe(gulp.dest(source + '/Public/Styles'));
});
minwe commented 8 years ago

Got this error on node v0.10.40.

minwe commented 8 years ago

@Scriptura I think you should update your node.

https://github.com/postcss/autoprefixer/blob/09624a74a0aeca741df706a9779ec9f264dbec4f/.travis.yml

Autoprefixer 6.x do not support node 0.10.x.

Scriptura commented 8 years ago

Right, everything now works. Thank you a lot !

arifcakiroglu commented 6 years ago

if you have a class name starting with number you will get this exception.

for example:

.360icon{}