-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug] TS2742 The inferred type of … cannot be named without a reference to … #227
Comments
Turns out this was due to |
There was actually another set of these errors that came from having two versions of |
I solved it by move project position to a clean folder which has no parent
will get error:
but if
everything is OK. |
Happened because not defineing the return type of an async function. I defined the return type as |
I also encountered this problem in monorepo. My solution is to remove the |
I've another note on the topic: I've removed PNPM and used just NPM in the cost of less obvious phantom package detection (but lint covers this). 99% of TS problems dissapeared when I've switch to NPM (or maybe YARN). |
Describe the bug
When using pnpify, ttypescript, and yarn workspaces, trying to compile (
pnpify ttsc -b -p tsconfig.json
) one of my workspaces I receive numerous TS2742 errors, one example is:In one of my workspaces there's 20 of these, so I could go around and actually add type annotations to these, but it would be a regression in developer experience to have to do this. Looks potentially related to microsoft/TypeScript#29221
To Reproduce
Not sure what the minimal reproduction is, I can do more investigation if this issue is foreign and needs more explanation.
Environment if relevant (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: