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

Invalid prop: type check failed, Expected Object when using keyof on type intersection #11129

Closed
CamilleDrapier opened this issue Jun 14, 2024 · 0 comments · Fixed by #11132
Closed

Comments

@CamilleDrapier
Copy link

Vue version

3.4.27

Link to minimal reproduction

https://play.vuejs.org/#eNrNlm1r2zAQx7+KphdzC53DHmCQuYHYsZPtxVa2wt4YSuZcUre2ZSQlTQn+7jtJ8VPrNnFgsDchkn4n3/9Od9KOjvPc3qyBDqkjIh7nkgiQ63wUZnGaMy7JjnBYkoIsOUuJhahVLXkszcf7BXugR2ov60uLcFuE20F4LcLrICYtYtJB+C3C7yCCFhF0ENMWMe0gZi1iVhJhFrFMSJKKFblU8TqzZpAkjPxmPFm8sc7DzBmY8GJgcSAhzZO5BBwR4ty+H+122rgonAGO9KyJ7lCCkJch3ZFsnsKQWGo8tkgR0pFjYl7jbgNPWDSXMcvQRLAUHm6BQ9PMrc28hlnEEsaH1p8ElV10bkIgEa2dvHqnCdlvVBpW0KSG/BJSiirAr4GgEwhqYNoJTGtg1gnMEHAGjdjTCyoFpm4Zr+w7wTKsgp3aI6QR4nEC/EeuVIiQDoleUWtzzOzDNz0n+RouyvnoFqL7jvk7sVVzIb3iIIBv0KFqTc75CqRZ9n99hy3+rxZTtlgnSL+y+BMES9Ym0gpz19kC3W5w2tuv+gjH2epa+FsJmShFKUcVWWg+pHigVaRekl67+9H+pO3CrMAoVrX/tI+QZJ6tMA8S92n2FPmYA7nGn3HVWuyBmhSmnhawjDO44iwXjv66yufQWKCrxejsHLnXimoRb/QfQq5VxZB3BGtM7WKrM4GVpqmBwZ6dCuWJLQXKqVxW33ZLb0NqDxYA+Y0mQ6ocgK0mG9IuTeRM5QrJMQHK+S7YQ9h84a0xMoV4wCrYW41ftNonR7fd45KjN38iF5NTqz2YIfeUDLl1hg4kp/bEZOhpUNwy7nX3ehYPfcn0jofX+7B6p4TCaxxWnVAMSGOqlHUgTNVN+Y9l3sMjW54udnJM3vdy9LXeW06/FlPLOanR+D3k6DdIbznBiXKCU+QEPeToB9P/nZ3p0U2met8dEPSqn+WjzbSfQjXpZ01JX729hcyOFnKzAa6ue9SBd7b94TMt/gLqAw2F

Steps to reproduce

There should be no warning about prop type mismatch when opening the reproduction link;

Alternatively if a prop is declared as keyof TypeX where typeX is an intersection type defined in another file (with simple key: value fields), then a warning will apear with the expected type being Object instead of string.

What is expected?

There should be no warning about prop type mismatch when opening the reproduction link

What is actually happening?

There is the following warnings:

[Vue warn]: Invalid prop: type check failed for prop "test". Expected Object, got String with value "location". 
  at <CompD test="location" > 
  at <Repl> [srcdoc:172:23](about:srcdoc)
[Vue warn]: Invalid prop: type check failed for prop "test". Expected Object, got String with value "name". 
  at <CompF test="name" > 
  at <Repl>

System Info

System:
    OS: Linux 6.5 KDE neon 6.0 6.0
    CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
    Memory: 14.80 GB / 30.97 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm
  Browsers:
    Chrome: 126.0.6478.55
  npmPackages:
    vue: ^3.4.27 => 3.4.27

Any additional comments?

This might be related to the following:

#9319
#11002
vuejs/language-tools#4469

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant