Subscribe on changes!

defineEmits typed not working when use export of type

avatar
Oct 16th 2022

Vue version

3.2.41

Link to minimal reproduction

https://sfc.vuejs.org/#eNp1Uk2PmzAQ/SsjXyBSAneaoPaQSj336guQIesV/pA9ZltF/PeODdmk7S4n5uu9mfd8E9+cq+aIohFHQu2mjrCVBvg7jtZr+BpirxVVzuOMhk5ScCIMXvUoxdaZu6eux6k9605Nj2yuKOMiwXzQ9oITA2DuEUC/HT7C+hmsXtGeMn0ksqb9eSc/1ltmW7ZO23JwrP85g1NpwhFMnbkyHwXmDkjRcYfSznqCG/zYkB0pa74z1pmvDrDA6K2GoqoxxcWXx4jHcQ9vHQ0v9ybWsZBGmsGaQJAG4AQXHJXBjHb8mKQtd89TrAaPMXpZFDteX5pMUubKHsodnFq4rccljrJ4d6SJAX2xX0GquZsiMvSS4cdohkQL793lroFzMvUTtILnUtqzVt6AiRM7uySJ1xtasRerGAfdueo1WMPPKGPJrcBSN3d0KVifFEvxQuRCU9dhHNLjew2V9dea/yofDSmNFQZ96L1943sYWIoEwdQLU2YjKgrMhb+yFcoQ+rEb8DMXtw1KbOD5vAZmqy5s6f/Fv5RsIJBX5voYWMTyB4dLFyI=

Steps to reproduce

  1. create file, emits.ts and create a interface and export
  2. set the interface created for type on defineEmits

gif

What is expected?

not show error

What is actually happening?

show error: [vite] Internal server error: [@vue/compiler-sfc] type argument passed to defineEmits() must be a function type, a literal type with call signatures, or a reference to the above types. error

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (16) x64 AMD Ryzen 7 3800X 8-Core Processor
    Memory: 20.44 GB / 31.92 GB
  Binaries:
    Node: 16.18.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.525.0), Chromium (106.0.1370.42)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vue: ^3.2.41 => 3.2.41

Any additional comments?

I am using nuxt 3 for the project

avatar
Oct 16th 2022

This is the same as #4294