When build in node.js fails detailed error message is not printed #196

Closed
maxlk opened this Issue Jun 13, 2012 · 3 comments

Comments

Projects
None yet
2 participants

maxlk commented Jun 13, 2012

When build script fails, node.js doesn't flush stdout and stderr streams. Because r.js uses console.log() (which writes to stdout) user doesn't see error message and it's hard to understand what happened.

Solution can be in using blocking output instead of console.log(). In this way:

define('node/print', ['fs'], function (fs) {
    function print(msg) {
        fs.writeSync(process.stdout.fd, msg + '\n');
        fs.fsyncSync(process.stdout.fd);
    }

    return print;
});

@jrburke jrburke closed this in 0889064 Jun 18, 2012

Owner

jrburke commented Jun 18, 2012

Thanks for tracking this done, latest master snapshot has this change now, will be part of 2.0.3.

jrburke added a commit that referenced this issue Jul 10, 2012

@jrburke jrburke reopened this Jul 10, 2012

Owner

jrburke commented Jul 10, 2012

I needed to back this out since it was causing errors when r.js was driven by other programs, like via a volo command. Still need to figure out what happened, but need to back it out for now, and do a 2.0.4.

jrburke added a commit that referenced this issue May 9, 2013

Merge pull request #421 from Nemo157/sync-node-output-196
Alternative solution to #196, proper wait for draining std channels.
Owner

jrburke commented May 9, 2013

Fixed in #421.

@jrburke jrburke closed this May 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment