-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
What happened?
When I try to use Field's props' type with ComponentType, Nuxt throws.
Reproduction steps
I can infer OK, but when I use it in defineProps, error happens:
<script setup lang="ts">
import { Field } from 'vee-validate'
import type { ComponentProps } from 'vue-component-type-helpers'
type Throws = ComponentProps<typeof Field>
const { placeholder } = defineProps<Throws & { placeholder?: string }>()
</script>
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
- Firefox
- Chrome
- Safari
- Microsoft Edge
Relevant log output
The mess
stack: '[@vue/compiler-sfc] Unresolvable type: TSConditionalType\n' +
'\n' +
'<path>/node_modules/vue-component-type-helpers/index.d.ts\n' +
'1 | export type ComponentType<T> = T extends new (...args: any) => {} ? 1 : T extends (...args: any) => any ? 2 : 0;\n' +
'2 | export type ComponentProps<T> = T extends new (...args: any) => {\n' +
' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n' +
'3 | $props: infer P;\n' +
' | ^^^^^^^^^^^^^^^^^^^^\n' +
'4 | } ? NonNullable<P> : T extends (props: infer P, ...args: any) => any ? P : {};\n' +
' | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n' +
'at createError (<path>/node_modules/h3/dist/index.mjs:71:15)\n' +
'at <path>/node_modules/@nuxt/vite-builder/dist/index.mjs:423:21)\n' +
'at async processMessage (<path>/node_modules/@nuxt/vite-builder/dist/index.mjs:405:30)',
message: '[@vue/compiler-sfc] Unresolvable type: TSConditionalType\n' +
'\n' +
'<path>/node_modules/vue-component-type-helpers/index.d.ts\n'
+
'1 | export type ComponentType<T> = T extends new (...args: any) =>
{} ? 1 : T extends (...args: any) => any ? 2 : 0;\n' +
'2 | export type ComponentProps<T> = T extends new (...args: any) =>
{\n' +
' |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n' +
'3 | $props: infer P;\n' +
' | ^^^^^^^^^^^^^^^^^^^^\n' +
'4 | } ? NonNullable<P> : T extends (props: infer P, ...args: any)
=> any ? P : {};\n' +
' |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^',
Demo link
https://stackblitz.com/edit/vee-validate-v4-radio-jixy4ksw?file=src%2FRepro.vue,src%2FApp.vue
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels