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

Type of prop doesn't match type of ref when the type includes a class with a private property #10862

Open
zomakus opened this issue May 5, 2024 · 1 comment

Comments

@zomakus
Copy link

zomakus commented May 5, 2024

Vue version

3.4.26

Link to minimal reproduction

https://play.vuejs.org/#eNqtU8Fu2zAM/RVOlyRA4gDbsEPqBuiGHrpDV3Q9ChgEh0nd2pIhyUkAw/8+UrYVp9u6HuqLbfI96vGJbMRVVSX7GsVKpC6zeeXBoa8rKJTeXUrhnRRrqfOyMtZDAxa3c8hMWdUeN3O4xy20sLWmhAlVmYyQV/SpiphNlioEEu8mFxHWgW48lhF2CrEuxkqdGe08dAX4yEvWkXbI9VTjoS80nWzMbjKbnTO+KUdiI+8MnylPeFCOWxkqvqD33RJ7aDwePZ3B5RrGBUtTOwwS0mVnKJWjH+qnKpRH+gNIaz4E6Ek/LBbw8Jg7yBQRHaC1xsJiMeRHDq06PXQr0QkpYPlHpYOxz45bwmOFGSt/U7lo07sW7R2LNdNl6D1djgwRc5ozsnyb75InZzQNY8NYKdjwvED7o/I5XYkUKwgZzqmiMIfvIeZtjfMhnj1i9vyX+JM7ckyKO4sO7R6liDmv7A59l77+eYtH+o7J0mzqgtCvJO/RmaJmjR3sa603JHuEC2pvwtTnevfgro8etRuaYqGMbANeCpp8du5frZ/kfko+B57ULbl4vjtv3enXN1XqDW5zjXfWVC5t+qVYRdZ6+p9ZL/J+TpqBnJD4W1UibU9LynkoAujlUEQd1AmNHavNCuXccHYjLbMrm++JA5pKrsB5SwZfdKmwx7bOvLHTcXo2cAE8TXfCOdpvfvXMtntFpQPzRLTkqdUn/ojHd/Frj5bvl7TTJSUfv4j2N6/v0Gc=

Steps to reproduce

Download the project from the minimal reproduction link (prop type validation is not working correctly in the link, not sure why) and install dependencies, you should see the following error in the file App.vue:
Captura de pantalla (43)

What is expected?

The type of the ref should match the type of the prop and don't cause any errors.

What is actually happening?

The type of the ref doesn't match the type of the prop and causes an error when the type is (or includes) a class with a property that uses the private modifier.

System Info

No response

Any additional comments?

For some reason the error only occurs when using a ref where the type is inferred or passed as a generic argument, when casting the type using Ref or when using computed there doesn't seem to be any errors.

This other issue seems to be related: #10476

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