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

Optional prop still throws required type error when using function signature. #12637

Open
youranreus opened this issue Jan 2, 2025 · 2 comments

Comments

@youranreus
Copy link

youranreus commented Jan 2, 2025

Vue version

3.4.31

Link to minimal reproduction

https://play.vuejs.org/#eNqtU02P0zAQ/SuDL+lKVboITiENgqoScFhWu5U4YIRCMmm8JHawnVLU5r8zdj62q1Z72lyc+fCb92bGB/ahacJdiyxiscm0aCwYtG2TcCnqRmkLq1JUORRa1RCEi8xZoTX74N2UcQCNBXRDDoEFXHKZKWks1GYLSxefBZ+wqhR8U7rKXwVXXMaLviCVIsNi3VSpRbIA4vJ1cjj4y10XL8jy3p6KFbbCJWdlWqacQWTLtv5lyHFN1oIy48UJGJsza4hLIbbhg1GShB4cGGeZqhtRof7aWEFcOYvAR1wsJap/v3if1S3OR39WYvb7gv/B7J2Ps1uNBvUOOZtiNtVbtH14fX+De/qfgrXK24qynwneoVFV6zj2aR9bmRPtkzzP9rMfhpDbjVnvLUozinJEXWbn8zmjAa2ekf5I90341t/jsqMuTpOnDk6Dz7EQ0sMpidLO4d4tz0pJS0rmYNUdFuZsNey/BuFWq8bEm4TWw9f2Y43AWE0anCNHk70/dfSDjmBDhAaQdS2scQjkwL0nRZTStvLnKbWZ36ANEC+UuQFJWKjhOOAns8bxiSZac/hJW+NkRE9Exb5kcgXLZOyZprCWMPM+X8d9cS52lOJhQy+uo2qD7bTB8QiBVF5ncBLrZdLaO4AejV7LOL+hpkxralbgX0QwLMKgYMiYOjrZ5KGekRyveLjkvqFlhDdC9bL+tEJj/mTVRxr9NZO9BHyRVuYS/jjvswrfhxJw44f441Kt6zPA/qRFoW6y7j9qfplB

Steps to reproduce

use defineComponent in function sgnature to define a genric component with an optional prop

image

use the component somewhere else.

image

In my minimal reproduction, just simply remove one of child component`s prop and add it again can repoduce the error.

录屏2025-01-02 20 08 37

What is expected?

Optional prop should not throw required type error.

What is actually happening?

Optional prop still throws required type error.
image

System Info

No response

Any additional comments?

No response

@edison1105
Copy link
Member

I can't reproduce it on my local machine with

"vue": "3.5.13",
"typescript": "5.7.2",
"vue-tsc": "2.2.0"

@youranreus
Copy link
Author

youranreus commented Jan 3, 2025

I can't reproduce it on my local machine with

"vue": "3.5.13",
"typescript": "5.7.2",
"vue-tsc": "2.2.0"

Hi, thanks for your comment. I`ve tried the version same as yours and still has the same error. Can you reproduce it in the vue playground that I provide above?

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

2 participants