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

[vue-ts] ts compiler fails when handling input events in dom #2943

Closed
sltsm opened this issue Apr 11, 2021 · 2 comments
Closed

[vue-ts] ts compiler fails when handling input events in dom #2943

sltsm opened this issue Apr 11, 2021 · 2 comments

Comments

@sltsm
Copy link

sltsm commented Apr 11, 2021

Describe the bug

When creating a project with the "vue-ts" template, the ts compiler is taking issue with the event-type of input-events.

Reproduction

  1. yarn create @vitejs/app reproduce --template vue-ts
  2. add <input type="text" @input="e => $emit('input', e.target.value)"> somewhere in the template
  3. run yarn build

Fails with:

src/components/HelloWorld.vue:3:50 - error TS2531: Object is possibly 'null'.

3   <input type="text" @input="e => $emit('input', e.target.value)">
                                                   ~~~~~~~~

src/components/HelloWorld.vue:3:59 - error TS2339: Property 'value' does not exist on type 'EventTarget'.

3   <input type="text" @input="e => $emit('input', e.target.value)">
                                                            ~~~~~
@sodatea
Copy link
Member

sodatea commented Jun 24, 2021

Upstream issue:
vuejs/language-tools#222
vuejs/core#1359

@sodatea sodatea closed this as completed Jun 24, 2021
@github-actions
Copy link

This issue gets locked because it has been closed for more than 14 days.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants