Can't use interface defined in `script` for `defineProps` in `script setup`
Vue version
3.2.37
Link to minimal reproduction
Steps to reproduce
Run the SFC Playground (in Chrome)
What is expected?
The exported interface can be used to define the props. As it is in the same file. Because the interface is also exported, it cannot be defined in script
block.
What is actually happening?
It doesn't compile.
System Info
System:
OS: Windows 10 10.0.19044
CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
Memory: 4.96 GB / 15.95 GB
Binaries:
Node: 14.17.0 - C:\Program Files\nodejs\node.EXE
npm: 6.14.13 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 103.0.5060.134
Edge: Spartan (44.19041.1266.0), Chromium (103.0.1264.77)
Internet Explorer: 11.0.19041.1566
npmPackages:
vue: ^3.2.37 => 3.2.37
Any additional comments?
When i don't export the interface, a different error is thrown (in my local IDE):
Transform failed with 1 error:
C:/[...]/Component.vue:23:25: ERROR: Unexpected ">"
Unexpected ">"
21 | expose();
22 |
23 | const props = __props as >()*/
| ^
24 |
25 |
Could be duplicate to #4423