Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: "no writecb in Transform class" #111

Closed
issander opened this issue Dec 5, 2014 · 20 comments
Closed

Error: "no writecb in Transform class" #111

issander opened this issue Dec 5, 2014 · 20 comments

Comments

@issander
Copy link

issander commented Dec 5, 2014

The error "no writecb in Transform class" is being thrown seemingly at random by the following task:

gulp.task('debug', function () {
    gulp.src('www/beheer/_lib/css/style.less')
        .pipe(plumber(function(error){
            gutil.log(gutil.colors.red(error.message));
            gutil.beep();
        }))
        .pipe(less())
        .pipe(gulp.dest('www/_lib/dist'));
});

After some searching I found the following issue that suggested that this particular error is caused by calling the callback function multiple times: geopipes/elasticsearch-backend#1

After placing some console.log lines in the gulp-less code it seems that the following part is to blame:

cb(null, file);

(index.js - line 68 - version 1.3.7)

In my case this callback is being called three times, the later two producing the error.

@issander
Copy link
Author

issander commented Dec 5, 2014

Some further testing revealed that the callback that is passed to less.render is being called multiple times (with err being false).

Calling less.render with a promise rather than a callback seems to fix the problem.

@stephenlacy
Copy link
Contributor

Please update to the newest version and confirm that these commits fixed your issue: #113

@issander
Copy link
Author

issander commented Dec 8, 2014

Thanks @stevelacy , I have just tested v2.0.1 that includes these commits and the issue has indeed been fixed.

@yocontra yocontra closed this as completed Dec 8, 2014
@jbcpollak
Copy link

We seem to be getting this same error with v3.0.1, is that possible?

@yocontra
Copy link
Member

@jbcpollak Wipe node modules and reinstall maybe?

@jbcpollak
Copy link

I guess we are seeing a separate bug with similar symptoms. It seems to be caused by the use of the CSS3 /deep/ feature.

It looks like gulp-less depends on less ^2.1.1 and support for /deep/ was added in less 2.4.0.

less/less.js#2023

When we removed /deep/, the problem went away. Any chance an updated gulp-less could be released to depend on the newest less?

@yocontra
Copy link
Member

@jbcpollak done

@yocontra
Copy link
Member

Also you can just npm update, we use the range ^2.1.0 which includes 2.4.0

@jklmli
Copy link

jklmli commented Mar 19, 2015

Seeing this issue with gulp-autoprefixer on 3.0.2.

@yocontra
Copy link
Member

@jiaweihli So open it on gulp-autoprefixer 🌴

@wrightling
Copy link

I get this same error with gulp-less 3.0.3, but not if I go back to 3.0.2. I'm not super familiar with the npm module open source world - what can I provide that is useful in terms of information?

2.0.0-p247 in customer_commerce/ on develop-ever
› npm list gulp-less
npm WARN unmet dependency /Users/wwright/Dev/web/frontend/customer_commerce/node_modules/gulp-eslint requires eslint@'^0.18.0' but will load
npm WARN unmet dependency /Users/wwright/Dev/web/frontend/customer_commerce/node_modules/eslint,
npm WARN unmet dependency which is version 0.19.0
customer-commerce@0.0.1 /Users/wwright/Dev/web/frontend/customer_commerce
└── gulp-less@3.0.3


2.0.0-p247 in customer_commerce/ on develop-ever
› gulp less
[12:38:24] Using gulpfile ~/Dev/web/frontend/customer_commerce/gulpfile.js
[12:38:24] Starting 'less'...
[12:38:27] [less] [Error: no writecb in Transform class]

Obviously I can open a new ticket, as this one is closed, but thought someone here might see a notification and already know why I'm seeing this and why it's not really an issue :P

@yocontra
Copy link
Member

This is a weird thing that pops up sometimes where npm fails to install a dependency correctly (I think readable-stream). rm -rf node_modules && npm install to make things work correctly when npm shits the bed.

@AnatolyRugalev
Copy link

I had this issue when used old version of nodejs (0.10). Resolved with upgrading it to 0.12

@mark-williams
Copy link

Upgrading node did the trick for me too.

@sbhaktha
Copy link

sbhaktha commented Feb 8, 2016

I am seeing this issue! Using

    "gulp": "3.9.1",
    "gulp-less": "3.0.5",

Any ideas? Thanks!

@brettwhiteman
Copy link

Same here @sbhaktha

@brettwhiteman
Copy link

Ok updating nodejs fixed it

@vlaim
Copy link

vlaim commented Dec 13, 2016

I got this problem after updating to gulp 4 🤔

@wmai
Copy link

wmai commented Sep 22, 2017

I got this problem after updating to gulp 4
- vlaim

Me too.

@flakfire
Copy link

flakfire commented May 3, 2018

I was able to fix this by re-installing Ruby with devkit and through the ruby command prompt run gem install slim after 'npm rebuild'. For some reason, this fixed it for me and was able to properly build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests