Giter Site home page Giter Site logo

Comments (5)

kgdev avatar kgdev commented on June 20, 2024

var pid = gutil.colors.magenta( app.child.pid );

TypeError: Cannot read property 'pid' of null

from gulp-develop-server.

nforysinski avatar nforysinski commented on June 20, 2024

This issue is most persistent when watching the many results of a js/css set of gulp tasks. For instance, I have several js and css files that need to be minified and linted, which then get moved to a "dist" folder. My develop task is as follows:

gulp.task('watch', ['server:start'], function () {

    var notify = function(file) {
        server.changed( function( error ) {
            if( ! error ) lr.changed( file.path );
        });
    };

    gulp.watch(paths.css, ['sass']);
    gulp.watch(paths.html, ['compresshtml']);
    gulp.watch(paths.js, ['lint', 'compressjs']);
    gulp.watch(['./public/dist/**/*']).on('change', notify);
});

This yields the child pid error as well as several other event errors.

from gulp-develop-server.

chimerast avatar chimerast commented on June 20, 2024

I think this issue is caused by a bug of checking multiple restarts.

https://github.com/narirou/gulp-develop-server/blob/master/index.js#L206-L210

    // already called this function
    if( isChanged ) {
        isChanged = false; // *** I think this line cause the problem. It is unnecessary code. ***
        return done( null, 'Development server already received restart requests.', callback );
    }

It calls the kill function multiple times when the watcher task calls restart multiple times in a very short time.

from gulp-develop-server.

narirou avatar narirou commented on June 20, 2024

@kgdev, @nforysinski, @chimerast
Thank you for the detailed report.

As it is said, the value of isChanged was incorrect.
This bug made it possible to send a restart request many times.

But, as a result, I do not know whether this issue has been fixed yet.
I plan to verify the reproducibility of this issue, and add more test code.

from gulp-develop-server.

narirou avatar narirou commented on June 20, 2024

I think this error fixed by previous commit. (thanks @chimerast)
If not, please reopen this issue. Thanks.

from gulp-develop-server.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.