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() type cannot use computed keys #8040

Closed
sqal opened this issue Apr 5, 2023 · 0 comments · Fixed by #8041
Closed

defineEmits() type cannot use computed keys #8040

sqal opened this issue Apr 5, 2023 · 0 comments · Fixed by #8041
Labels

Comments

@sqal
Copy link
Contributor

sqal commented Apr 5, 2023

Vue version

>= 3.3.0.alpha.7

Link to minimal reproduction

https://sfc.vuejs.org/#eNqNULtuwzAM/BVCSx6wrV11AnToL3SpOrg24yqwHhApdwj875WSDO4DRReKJ4p3uruIxxCaOaFQoqU+msBAyCnA1LnxoAWTFkftAOS+1N47YkBrGA4w4Mk4fMqA2kuZAmxRwSaFoWNU1g84PXdTwk0FczkVEEfjxp2C2ZuhrCzH7e6hNHtZ6n80fuFX8PJF4HVF3cqbr+wiA0Ybprx9Q3IFRSWMDT5ybbvQnMm7nMlVUt8HOQoF909okUMrWIt35kBKSjr1JckzNT6OMndNTI6NxQbJ1m/RfxDGTKxFteKQ+XLGWEd0A0aMf3F+e/qD9+pau0UsnwwOoOY=

Steps to reproduce

<script setup lang="ts">
  const emit = defineEmits<{
    'update:modelValue': [value: string]
  }>();
</script>

What is expected?

Should compile component without error.

What is actually happening?

Error: [@vue/compiler-sfc] defineEmits() type cannot use computed keys.

App.vue
8  |    
9  |    const emit = defineEmits<{
10 |      'update:modelValue': [value: string]
   |      ^^^^^^^^^^^^^^^^^^^
11 |    }>();
12 |  </script>

It seems bug was introduced in commit ef73ea5

@LinusBorg LinusBorg added scope: compiler 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. 🐞 bug Something isn't working and removed 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels Apr 5, 2023
IAmSSH pushed a commit to IAmSSH/core that referenced this issue May 14, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants