Can't use TS generics when defining a type for defineProps
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
I'm using script setup with TypeScript and Nuxt3.
I have a Props type which works perfectly fine, but using a generic makes it break (except 'Partial', 'Required', 'Readonly', 'Pick', 'Omit').
type Props = ... //works
type A<T> = T // should also work
const props = defineProps<Props>() // works
const props = defineProps<A<Props>>() // doesn't work ([plugin:vite:vue] [@vue/compiler-sfc] Unresolvable type reference or unsupported built-in utility type)
What is expected?
That the generic wouldn't change anything
What is actually happening?
[plugin:vite:vue] [@vue/compiler-sfc] Unresolvable type reference or unsupported built-in utility type
System Info
System:
OS: Windows 10 10.0.22621
CPU: (12) x64 AMD Ryzen 5 5600H with Radeon Graphics
Memory: 6.96 GB / 15.34 GB
Binaries:
Node: 20.5.0 - C:\Program Files\nodejs\node.EXE
npm: 9.8.1 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.22621.2134.0), Chromium (115.0.1901.203)
Internet Explorer: 11.0.22621.1
npmPackages:
vue: ^3.2.47 => 3.3.4
Any additional comments?
Pretty sure there are other issues but they're all saying it's a specifc generic that doesn't work, for me it's all generics (except 'Partial', 'Required', 'Readonly', 'Pick', 'Omit'), which is confusing since everone seems to have the same error. Maybe they didn't realise it's all generics. I remember hearing once something like this didn't work and someone on StackOverflow told me the ones that do work, but that's all I know. Could be a duplicate, if it is, I want to know the issue.
I'm just generally confused, hope someone can clear this up
duplicate of https://github.com/vuejs/core/issues/8482