vuejs / core

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
https://vuejs.org/
MIT License
47.64k stars 8.33k forks source link

Template attributes aren't type checked #12258

Open richardsimko opened 2 weeks ago

richardsimko commented 2 weeks ago

Vue version

3.5.12

Link to minimal reproduction

https://github.com/richardsimko/vue-bug

Steps to reproduce

  1. Use a <template> element in a v-for

  2. Use an invalid value for v-bind:key

  3. Check out the example repo

  4. Run npm run type-check

What is expected?

Type error on the invalid property use in v-bind:key

What is actually happening?

No error

System Info

No response

Any additional comments?

No response

edison1105 commented 2 weeks ago

image I don't get it. Isn't that a type error?

richardsimko commented 2 weeks ago

You're right, it does show up in the playground but not when running locally. I updated the issue with the new repro link.

I made a repro repo from using npm create vue@latest: https://github.com/richardsimko/vue-bug

Running npm run type-check only outputs the following error:

image
KazariEX commented 2 weeks ago

vuejs/language-tools#4539

richardsimko commented 2 weeks ago
image

Now it's back to not working in the playground either... Not sure what was going on before.

https://play.vuejs.org/#eNp9ks1OwzAQhF9l8aUgmZRSfqtQCRAScAAESBwwQiHdhIBjW7ZTiqK8OxuHtoBQc8rujDffTlyzY2OiaYVsxGKX2sJ4cOgrAzJR+ZFg3gk2FqoojbYearCYQQOZ1SX06FhPKKFSrZyH0uVw1OrrvXOUUsODtnKy1ttYWlBiicq7zherqnxB+/g0Xn8ccNjmMOSww2GXwx6HfQ4HHA45DLaewoi43/ERDRUeSyMTj1QBxK+DcV0HgqaJ+1SFbqFM5WG6WeoJStqFdMGgH8RgmA8hT6YtOb4BoVALVjoxesfPpRhlWkcviQ25AD2xoY//EVsM01H0f6D+KhindCmYrMijN6cV/YI6oLFUl6aQaK+NLyg4wUYQlFZLKNqPy9DztkI+76evmL7/039zs7Yn2I1Fh3aKgi00n9gcfSef3V3hjN4XIqVWSXKvEG/RaVm1jJ3tpFITwv7hC7QX4fIUKr93ZzOPys2XakFbZxP8gtGFOl2x+hJ3GO2Ec0I1lOLzFG07kwIcRrvRYJs1X2Cu7Sw=