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

Component names may not match other component properties #3411

Open
scottbedard opened this issue Jul 15, 2023 · 2 comments
Open

Component names may not match other component properties #3411

scottbedard opened this issue Jul 15, 2023 · 2 comments
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@scottbedard
Copy link

scottbedard commented Jul 15, 2023

Reproduction

I'm not sure if this is a bug or desired behavior, but it appears component names may not match other properties of that component.

https://play.vuejs.org/#eNp9U8Fu2zAM/RVOhzkFEhtrtkvnFeiKAtsO29D1qItnM45aWTIkOkkR+At22hfsF/cJo+TZSYC2F1skH6lH8mkvrto23XQoLkTuS6daAl2Y+oMU5KW4lEY1rXUEe6hwpQxeW7YNGoIeVs42kHBy8n7ClWulq/+RNLsOVigfENLgLmK4UtHp+D+uONtLA1COpr+A6GBXqDIP5z5+A6QjrE4Bs7PRBHBInTPw5nwJWQb5Amit/JQHrbMtOnoEUzTIbq1VhR62itaMDJ6xyQAYig5Xh29/Jk2eDcPiAbFB2LS6IGQLIH+1WAwpV67umlDFroAeW4Rk3yfARIwlKLxXtSl+agSy0BaObyJ0B2wg/xpusbSuyj05Zeo5dObB2K25TNKx1buXC0+1kpT87Hz59h2zB1gsBq7DujI28uyoCzHn9ZfWrFSd3ntrWB1xtlKE0SiN7ltLyhqWyLQEKQqt7fZL9JHrMA4s5qyxfHjCf+93wSfFd4ce3QalmGJUuBppCN/8+Io7Pk/BxladZvQLwVv0VneB4wD72JmKaR/hItvPUbU82jt/syM0fmwqED0oTgrWcBDqc60f6C7TZcxjnfAUpwcQ3tepTCq1iQeAT8hUhjcT1Rd3ctDg3z+/f8WMbEg53VT/D7oAP8M=

Expected result

Either the child component should fail to render, or the compiler should throw no errors.

Actual result

The child component renders successfully, but typescript errors are thrown due to the naming collision.

Additional context

This appeared to work as expected prior to the release of 1.7 and 1.8.

For now it's easy to side-step by simply choosing a different name, but in large codebases, and specifically in large components, it adds a hurdle to migrating Vue 2 → 3 because the error messages can be difficult to diagnose. This problem will also start appearing without dependency upgrades in VSCode due to the extension updating automatically.

@so1ve
Copy link
Member

so1ve commented Jul 15, 2023

Related to #3350, #3374

@so1ve so1ve added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Jul 15, 2023
@rchl
Copy link
Collaborator

rchl commented Jul 26, 2023

I've added some extra comments about that in #3374 (hard to pick the issue to comment in).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants