-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken (unrelated) ambient types in the user's node_modules can cause --emit-tsd builds to fail #22996
Comments
With |
@brendandahl From what I understand, So I think, it's sensible to toggle it off when we're just typechecking our own code, especially if that code is self-contained (i.e. it doesn't rely on any 3rd party ambient types itself). With It seems common practice to use the flag:
|
We don't need to validate other types when generating definitions since they may be in bad state. Fixes emscripten-core#22996
…emscripten-core#23019) We don't need to validate other types when generating definitions since they may be in bad state. Fixes emscripten-core#22996
The
tsc
invocation here seems sensitive to unrelated broken types present in the usersnode_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 totsc
. Or alternatively, perhaps invoking tsc in some temporarycwd
that is not the user's project, where we're not going to trigger random errors from npm dependencies.The text was updated successfully, but these errors were encountered: