Skip to content

The error message is confusing when the callback of transform implementation is called multiple times #12513

@kt3k

Description

@kt3k
  • Subsystem: stream

When we call the callback of transform implementation multiple times like the below:

const { Transform } = require('stream');
const t = new Transform({ transform (chunk, enc, cb) { cb(); cb(); } });
t.write('aa');

It emits the error event with the message Error: no writecb in Transform class.
The message talks about the internal implementation writecb and doesn't make much sense to the users.

I think it's more informative to give the message like Inappropriate multiple calls of callback of transform implementation.

I saw many gulp users see and are confused by the above error message. 1 2 3 etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    errorsIssues and PRs related to JavaScript errors originated in Node.js core.streamIssues and PRs related to the stream subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions