vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.55k stars 373 forks source link

3.3+ defineEmits syntax errors when used with TS enum #4458

Closed scottbedard closed 2 weeks ago

scottbedard commented 2 weeks ago

Vue - Official extension or vue-tsc version

2.0.19

VSCode version

1.90.0 (Universal)

Vue version

3.4.27

TypeScript version

5.4.5

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 5.53 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
    npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
    pnpm: 9.0.1 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 125.0.6422.142
    Safari: 17.4.1

Steps to reproduce

Use 3.3+ syntax of defineEmits in combination with a Typescript enum

defineEmits<{
  [Some.Enum]: [],
}>()

Expected: Component should compile normally

Actual: [@vue/compiler-sfc] Unsupported computed key in type referenced by a macro

Link to minimal reproduction

https://play.vuejs.org/#eNp9UttOAjEU/JWTvqgRlwRMTFYgisFEH9R4eaLElN2zWNg9bXpBCOHfbXcFNTG8NTPTycy0G3atdbL0yFLWs5mR2oFF5zWUgmZ9zpzlbMAJyVdwqxRsOAEMhYE+HE2FOeK05cSp3YZu0gG7JidWoIW1aGs0x0ISjirpbG8Dx5hGlyQYnKSwVDKH7eD45HJv0T3deRRClo3F+Crka2eq0rJEc2aLbAJvZL3WyjjMITI+Hha4Bkng1hrBYIEGKQvwdA0CKpEZxelvnPF3lkkK40mdhFOv3cwQSrNWqJ8pKuQsmVtFYaO6Pme7MI/aSUVhorQZJnKiLNXnfY0547G1w7MPzBb/4HO7ihhnTwYtmiVytuecMDN0DT16ecBVOO/JSuW+DOoD5DNaVfqYsZENPeUh9i9dnfauilNKmr3a0coh2V2pGDQqt7Wes/AQNweq/8TtJuf1vfA9worvSzTRMwwYiKRzwbZfjgrQYw==

Any additional comments?

The older syntax of defineEmits works as expected

so1ve commented 2 weeks ago

Please report to vuejs/core.

scottbedard commented 2 weeks ago

Can do, thanks! https://github.com/vuejs/core/issues/11106