Skip to content

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

@maxlk

Description

@maxlk

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;
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions