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

defineEmits<{}>() cannot pass type-checking #2370

Closed
lsdsjy opened this issue Feb 9, 2023 · 0 comments · Fixed by #2371
Closed

defineEmits<{}>() cannot pass type-checking #2370

lsdsjy opened this issue Feb 9, 2023 · 0 comments · Fixed by #2371

Comments

@lsdsjy
Copy link
Contributor

lsdsjy commented Feb 9, 2023

Problem

Declaring empty emits like defineEmits<{}>() would fail the type-checking process.

Reproduction

https://stackblitz.com/edit/vitejs-vite-ibxwhy?file=src/components/HelloWorld.vue

Steps
Run yarn type-check.

Environment

vue@2.7.14, vue-tsc@1.0.24
(Also tested on vue@3, no errors but still get wrong types in template, where the msg is inferred as of type never.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant