Adding generic=
to <script setup>
makes it impossible to export types from SFC
#13410
Labels
generic=
to <script setup>
makes it impossible to export types from SFC
#13410
Vue version
3.5.16
Link to minimal reproduction
https://github.com/alexchexes/vue-test-generic-export/blob/master/src/App.vue
Steps to reproduce
generic="T"
attribute to the<script setup>
(<script setup lang="ts" generic="T">
)export type MyType = 123
, within that script setup scopeModifiers cannot appear here. ts(1184)
TypeScript error in VSCodegeneric="T"
and the error disappears, confirming the issue is related to thegeneric="T"
attributeReproduction:
What is expected?
No error should occur when exporting types after adding
generic="T"
to<script setup>
What is actually happening?
A
Modifiers cannot appear here. ts(1184)
TypeScript error appears as soon asgeneric="T"
is added to<script setup>
, but no error occurs when it is removedSystem Info
Any additional comments?
If this is a restriction of generic components, we should mention it in the generics section of the
<script setup>
docsThe text was updated successfully, but these errors were encountered: