Skip to content
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

Incorrect Union Types Suggestions in Vue + TypeScript Project #11758

Open
matvejs16 opened this issue Aug 30, 2024 · 1 comment
Open

Incorrect Union Types Suggestions in Vue + TypeScript Project #11758

matvejs16 opened this issue Aug 30, 2024 · 1 comment

Comments

@matvejs16
Copy link

Vue version

3.5.0-rc.1

Link to minimal reproduction

https://play.vuejs.org/#eNq1VFtv0zAU/iuWXwrSmgwKCEVZEUx7gAeYgEdLU0hOizfHNr6ETl3++85xlq7d1kmTtodK9fedy3duWfPP1mZdBF7w0tdO2sA8hGjnQsvWGofPtlLquHINWzjTskmWB/Dh2LTJbyJ0mQ+O6IKPAK1VVQB8MVbeOtOTseJfrHSQ4fJI8NlbwW9Q66A7e5iStdGITKJUDH9TqTsja8w7GiipL8ggr5pW6ty4BpxHmuVPkvD8eVJRPrbo9PHD4d5EEJ2Z1tLVan8yXyl4NNcLpClxzptR8gMePEZcyGV27o3GdVlTDMFrXASpwP2wQRrtBS9YYohDkeb/t4QFF+FgxOu/UF88gJ/7FWGCnzrw4DoQfMOFyi0hDPTJr++wwv8bsjVNVGj9CPkTvFGRNA5mX6JuUPaWXVL7NS291Mvf/mQVQPuxKBJKln2yFxx3n25gX+m3cmfZu+QndE9d3Lodurmdc6HJ2krP12tmnbE+o/mwvscLI/jOTPC5fbFMVXqJwwwoBNlwaYFRJqNBh1MKx44GfeMBFEzH9g+4VNHOCX7aoWiVCuaDw7YkgGSNAJbFroa4uIT3QyL4tGhUGJr4MPQARTewkBpSCeVuRfNXr7e+P9jesw6PEoeBrZ1l77PDqauzN7y/Bk7XnxI=

Steps to reproduce

  • Define a union type for a component’s props.
  • Use the component in code, omitting a required prop or adding an incorrect one.
  • Notice the lack of errors or suggestions.

What is expected?

VSCode/Typescript compiler should indicate missing or incorrect props based on the defined union types.

What is actually happening?

VSCode/Typescript does not correctly handle union types for Vue component props. Instead of displaying accurate suggestions or flagging missing/incorrect props, it either provides no feedback or incorrect suggestions. This issue disrupts the development process, making it difficult to catch errors related to prop types in Vue components.

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz
    Memory: 24.78 GB / 31.87 GB
Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.9.2 - ~\AppData\Local\pnpm\pnpm.EXE
Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

Any additional comments?

This issue seems related to how the Vue compiler handles union prop types.
Issue context can be found here for more understanding: vuejs/language-tools#4053

@Shyam-Chen
Copy link
Contributor

#8952 #9125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants