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

1.*.* breaks gulp task #271

Closed
lewisnyman opened this issue Dec 20, 2017 · 10 comments
Closed

1.*.* breaks gulp task #271

lewisnyman opened this issue Dec 20, 2017 · 10 comments
Assignees

Comments

@lewisnyman
Copy link

Since upgrading to 1.0.0+ I've encountered fails that I'm finding really hard to debug.

Node 6.4.0

Task

gulp.task('critical', ['generate-site'], function (cb) {
  return gulp.src('destination/**/*.html')
  .pipe(critical({
      base: 'destination/',
      css: ['destination/css/style.css'],
      inline: true,
      dimensions: [{
        width: 320,
        height: 480
      },{
        width: 768,
        height: 1024
      }]
  }))
  .on('error', function(err) { gutil.log(gutil.colors.red(err.message)); })
  .pipe(gulp.dest('destination'));
});

Error message:

events.js:163
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at exports._errnoException (util.js:1050:11)
    at TCP.onread (net.js:582:26)
@jdrzj
Copy link

jdrzj commented Jan 4, 2018

Hi, I got the same error when running critical.
I got node 7.3.0, gulp 3.9.1.
edit:
critical version: 1.1.0

@bezoerb bezoerb self-assigned this Jan 4, 2018
@jdrzj
Copy link

jdrzj commented Jan 5, 2018

I tried to rollback to version 0.9.1 with:
$ npm install [email protected] --save
but I got the error message:

[10:08:59] Using gulpfile ~/code/landing-pages/gulpfile.js
[10:08:59] Starting 'critical'...
Fatal undefined

@jdrzj
Copy link

jdrzj commented Jan 5, 2018

But running it from CLI works.

@bezoerb
Copy link
Collaborator

bezoerb commented Jan 8, 2018

Got the same error errors in my bump-dependencies branch
https://travis-ci.org/addyosmani/critical/builds/319980576

@fjorgemota
Copy link

fjorgemota commented Jan 31, 2018

I'm having the same problem here.

However, instead of just showing ERESET from times to times...I'm having the following error shown randomly - too:

[00:30:38] Protocol error (Runtime.callFunctionOn): Execution context was destroyed. undefined
[00:30:38] no writecb in Transform class

Curiously, this only happens when using public/**/*.html as the src to the gulp task. When using just public/*.html all runs fine.

@pocketjoso
Copy link
Contributor

[00:30:38] Protocol error (Runtime.callFunctionOn): Execution context was destroyed. undefined

This error is tracked in Penthouse and a fix for it is coming:
pocketjoso/penthouse#202 (comment)

It happens when the page the critical css generation is working on issues a redirect to another page (~~ window.url = something else).

@fjorgemota
Copy link

Oh. Nice!

Now it makes sense the fact that sometimes ERESET error is shown, sometimes that error is shown.

I will try today to execute spawn a new instance of critical for each HTML file found, to see if most files are, at least, processed (trying to avoid those who redirect to another pages).

Anyway, thanks for the answer. =)

@begincalendar
Copy link

Is anyone able to consistently reproduce this issue?

It occurs sporadically for me and hence is infeasible to debug.

@shiftie
Copy link

shiftie commented Mar 7, 2018

Hi, I can't use critical on Travis & sometimes it also fails in local as well with:

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at _errnoException (util.js:1022:11)
    at TCP.onread (net.js:615:25)

I'm using promise based flow:

critical.generate(....).then(....).error(....);

any updates concerning this?

edit.: @lewisnyman looks like this is related to websockets library not handling errors from 3.3.3 (version currently resolved from Penthouse dependencies (puppeteer)), so you can either force resolve [email protected] or wait for a Penthouse update to add an error handler.

websockets/ws#1256 (comment)

@XhmikosR
Copy link
Collaborator

XhmikosR commented Aug 7, 2019

This should have been fixed a long time ago.

@XhmikosR XhmikosR closed this as completed Aug 7, 2019
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

8 participants