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

Can't use interface defined in script for defineProps in script setup #6383

Closed
wagpa opened this issue Jul 30, 2022 · 1 comment
Closed

Can't use interface defined in script for defineProps in script setup #6383

wagpa opened this issue Jul 30, 2022 · 1 comment

Comments

@wagpa
Copy link

wagpa commented Jul 30, 2022

Vue version

3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#eNpdULtuwzAM/BVCS1ogsdHVUFx0a7duXbS4Dp0osB6g6DaAoX8vZRtFkE13FO94N6u3GKufCVWjdOrJRoax8+ejUZyMao23LgZimIFw2MMJB+vxk0JMkGGg4GAn2zvjAYzH2/LXekYauh7hg9HBXIaMN35tIDFZfzY+G6/r1U88BGzeCXmKDxf0wSeGuHge7y/QRb59en7UEjaOHaMgAH15ad9xHAN8BRpPuha88JGwnedNN2ddF6JI/a+rvVrTH1wXq2sKXlpa0phtIAc2a77CSREFG3Vhjqmp6zT0pdtrqgKda3lVNHm2DitM7vBN4TchibBRRUI6ySr/Aa/ojP8=

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

@edison1105
Copy link
Member

duplicate of #5830

@github-actions github-actions bot locked and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants