-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Ignoring node_modules #45
Comments
The errors above happened when @types/node@8.10 is in node_modules:
Once I updated the dependencies in that project to not have any versions of @types/node older than 10.14, tsd ran successfully. |
It's weird because I looked into this and |
Okay, I see what the problem is. I ship |
@SamVerschueren is there a workaround to exclude node_modules? |
@SamVerschueren Any progress on this? |
My guess is that Typescript still loads types in
|
Reason: seems the minor versions in v7 do not respect semver rules There is a breaking change in terms of the exposed interface between minor versions 7.0.8 and 7.1.7. Specifically the ConnectedComponentClass type is not exported in 7.1.7. ConnectedComponentClass is used by onaio/js-tools. as a result tsd complains that the above type is not present in node_modules @types/react-redux, which in itself is another problem since tsd should not be evaluating types in node_modules, apparently there has been an issue raised for this and its unfortunately something we cannot fix from here. for Reference: tsdjs/tsd#45
Reason: seems the minor versions in v7 do not respect semver rules There is a breaking change in terms of the exposed interface between minor versions 7.0.8 and 7.1.7. Specifically the ConnectedComponentClass type is not exported in 7.1.7. ConnectedComponentClass is used by onaio/js-tools. as a result tsd complains that the above type is not present in node_modules @types/react-redux, which in itself is another problem since tsd should not be evaluating types in node_modules, apparently there has been an issue raised for this and its unfortunately something we cannot fix from here. for Reference: tsdjs/tsd#45
Can confirm @fregante 's solution works 🙏 Added this to "tsd": {
"compilerOptions": {
"lib": [
"DOM"
]
}
} |
Not immediately an out of the box solution yet though. Sorry about this. |
I wanted to look into this again, but can't seem to reproduce this. Does someone have a minimal example on how I can trigger this behaviour? |
I have another guess for why this happens: I think last time I had this issue was because the d.ts file was not actually listed in tsconfig, so I think typescript tried automatically looking for files, including node_modules in the process. |
@SamVerschueren - we are seeing fails here - which I think is caused by this issue. Just diving into it now. |
Follow up - it looks like the fail in the above instance is from an underlying upgrade to With My question at this point - should we be explicitly including |
Getting this today, but for things unrelated to node or browsers:
(dtslint has the same problem btw) |
@wooorm have you found a solution? |
micromark/micromark@c78c1c2 worked for us |
TS 4.2 might help understand why the files are being included |
@whs @TehShrike @likern @mskelton @fregante @p-netm @alexboffey @admataz @wooorm @pamls @derhuerst @belozer Would you mind testing my branch (https://github.com/BendingBender/tsd/tree/ignore-errors-from-node-modules) and reporting whether it fixes the problem for you? Thanks! |
Apologies for using issue as a support ticket.
I found that tsd ventures into node_modules and throw error from other modules:
Is there anyway I could fix this? Ideally, without moving the types into subdirectory. (Right now the types is at repository root)
The text was updated successfully, but these errors were encountered: