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

Regression in vue-tsc@2.0.15: dynamic argument type incorrect #4361

Closed
mdoesburg opened this issue May 9, 2024 · 3 comments
Closed

Regression in vue-tsc@2.0.15: dynamic argument type incorrect #4361

mdoesburg opened this issue May 9, 2024 · 3 comments
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@mdoesburg
Copy link

This bug was initially reported here: #2514

Slightly different TS error, but same result: null is not allowed to be used as a dynamic event name to remove the binding.

Reference: https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-value-constraints

image image
@johnsoncodehk
Copy link
Member

I cannot reproduce the issue, please provide minimal reproducible code or repo to help us be able to investigate it, thanks.

@mdoesburg
Copy link
Author

I cannot reproduce the issue, please provide minimal reproducible code or repo to help us be able to investigate it, thanks.

Minimal reproducible code:

<script setup lang="ts">
import { computed } from 'vue';

const props = defineProps<{ toggleEnter: boolean }>();

const eventName = computed(() => (props.toggleEnter ? 'enter' : null));

function handleEvent() {
    // noop
}
</script>

<template>
    <Transition @[eventName]="handleEvent" />
</template>

Error:

image

Seems to only be an issue with event handlers on components. Doesn't give me an error on HTML elements.

johnsoncodehk added a commit that referenced this issue May 13, 2024
@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first and removed need info labels May 13, 2024
@johnsoncodehk
Copy link
Member

It should fixed by 2a3ea17.

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

2 participants