Skip to content

In JS, extra circular reference errors when referring to a missing property on module #26268

Open
@sandersn

Description

@sandersn

I think this error is wrong, a result of #26236 combined with (probably) #25732. Here's a repro based on lodash:

var freeModule = module.nodeType;
var Buffer = module.nodeType ? root.Buffer : undefined;

/**
 * Creates a clone of  `buffer`.
 *
 * @private
 * @param {Buffer} buffer The buffer to clone.
 * @param {boolean} [isDeep] Specify a deep clone.
 * @returns {Buffer} Returns the cloned buffer.
 */
function cloneBuffer(buffer, isDeep) {
}

module.exports = cloneBuffer;

Expected behavior:
No error on either type reference to Buffer in a param tag.

Actual behavior:
Error on both, and both say they have a circular reference error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions