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

Typecheck error on component using generic and defineModel with a custom name containing a dash #4890

Open
andreww2012 opened this issue Sep 27, 2024 · 0 comments · May be fixed by #4892
Open
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🔨 p3-minor-bug

Comments

@andreww2012
Copy link

Vue - Official extension or vue-tsc version

2.1.6

VSCode version

Not relevant

Vue version

3.5.8

TypeScript version

5.6.2

System Info

Not relevant

package.json dependencies

No response

Steps to reproduce

https://stackblitz.com/edit/vitejs-vite-nctods?file=src%2FApp.vue

App.vue defines a generic as well as uses defineModel with a custom name containing dash.
Run pnpm test to type-check the project, and the weird error will occur:

App.vue:1:34 - error TS2304: Cannot find name 'A'.

1 <script setup lang="ts" generic="A">
                                   ~

A grammar error occurs if multiple generic parameters are present:

App.vue:1:35 - error TS1005: '>' expected.

1 <script setup lang="ts" generic="A, B">
                                    ~

Try to remove a dash from hello-world and see the both errors go away.

What is expected?

No such errors

What is actually happening?

They do occur

Link to minimal reproduction

No response

Any additional comments?

No response

@KazariEX KazariEX added bug Something isn't working 🔨 p3-minor-bug good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first and removed pending triage labels Sep 27, 2024
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 🔨 p3-minor-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants