-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Type checking fails for components loaded via defineAsyncComponent
#4789
Comments
I cannot reproduce it. Could you provide a minimal reproduction? |
I tried creating a minimal reproduction, but cannot seem to reproduce it outside of our main repo 😞 I noticed that it also only happens for some components, not all of them. I'll keep looking as to what could be causing this. |
Actually managed to reproduce it, you can see it here: Seems to happen on |
Enter the : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
+ : T extends (...args: any) => Promise<infer R> | void ? () => R
: T extends (...args: any) => any ? T Could this solve your problem? |
The |
You can patch the |
No, the issue sadly persists even after patching the file. |
It solved your repro on my machine, so I don't how to confirm the issue that occurred on your main repository :( |
I tested it on the repro on my machine too, where it failed 🤔 I've added |
Oh my god, I cannot read. I've added it before that line and now it works. I apologize for the inconvenience and thank you for the solution. |
Hello, I stumbled upon the same issue. |
The current solution is not elegant and may trigger other unexpected type inferences. We are currently unable to merge it into the main branch - please use the above workaround temporarily until then. |
Vue - Official extension or vue-tsc version
2.1.4
VSCode version
1.92.2
Vue version
2.7.16
TypeScript version
5.5.4
System Info
No response
package.json dependencies
No response
Steps to reproduce
const Component = defineAsyncComponent(() => import('path/to/Component.vue'))
and use it within the template.vue-tsc --noEmit
What is expected?
The check passing succesfully.
What is actually happening?
The following TS error:
Link to minimal reproduction
No response
Any additional comments?
This issue started happening in 2.1.4, 2.1.2 seems to work fine.
The text was updated successfully, but these errors were encountered: