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

v2.0.17 Reports Errors for Multiple Event Bindings #4369

Closed
aturingmachine opened this issue May 10, 2024 · 1 comment
Closed

v2.0.17 Reports Errors for Multiple Event Bindings #4369

aturingmachine opened this issue May 10, 2024 · 1 comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@aturingmachine
Copy link

Description

The following template (an excerpt) will be fine when vue-tsc is run using version 2.0.16, however will throw errors on 2.0.17.

<div
  @keyup.enter="handleCheck(option.value)"
  @keyup.space.prevent="handleCheck(option.value)"
>

Error:

src/components/base/base-radio-buttons.vue:14:8 - error TS1117: An object literal cannot have multiple properties with the same name.

14       @keyup.space.prevent="handleCheck(option.value)"
          ~~~~~

More Info

Our codebase is Nuxt, and we run typecheck via nuxi typecheck which runs vue-tsc via npx. Meaning this failure popped on our GitHub Actions where the npx cache misses vue-tsc and installs v2.0.17, however our local environments have v2.0.16 cached and do not report the error.

@scottbedard
Copy link

I'm running into this too, I was just about to open a ticket myself 🙂

https://github.com/scottbedard/vue-tsc-event-listener-type-error

This appears to be a bug though, Vue supports this syntax. Looking more at the compiled output, everything appears normal. The keydown listeners appear to be compiling correctly.

function render(_ctx, _cache, $props, $setup, $data, $options) {
  return (_openBlock(), _createElementBlock("input", {
    onKeydown: [
      $setup.onKeydown,
      _withKeys($setup.onEnter, ["enter"])
    ]
  }, null, 32 /* NEED_HYDRATION */))
}

@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels May 10, 2024
manuelleduc added a commit to xwiki-contrib/cristal that referenced this issue May 13, 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
Projects
None yet
Development

No branches or pull requests

3 participants