Skip to content

Broken (unrelated) ambient types in the user's node_modules can cause --emit-tsd builds to fail #22996

Closed
@jedrichards

Description

@jedrichards

The tsc invocation here seems sensitive to unrelated broken types present in the users node_modules/@types folder.

I believe TypeScript checks types in node_modules/@types, and it's not uncommon for these to be broken in some way (duplicate identifiers when multiple versions of the same package are present in a monorepo, 3rd party type incompatibilities and so on).

The issue is solved by passing the --skipLibCheck flag to tsc. Or alternatively, perhaps invoking tsc in some temporary cwd that is not the user's project, where we're not going to trigger random errors from npm dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypeScriptTypeScript Generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions