changing exported interface name during runtime fails
Vue version
3.3.4
Link to minimal reproduction
https://github.com/Disservin/vue-ts-interface
Steps to reproduce
Start the local dev with
npm run dev
then rename the exported interface in types/myinterface.ts
, you should now get an error
like
Failed to resolve extends base type.
If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example:
or
Unresolvable type reference or unsupported built-in utility type
If you remove the extends you also get an error.
If you directly import the myinterface
everything works again. So the issue seems to be related to the index.ts
file.
Also if you just restart the localhost it also works again.
What is expected?
No error
What is actually happening?
Failed to resolve extends base type.
If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example:
or
Unresolvable type reference or unsupported built-in utility type
System Info
No response
Any additional comments?
Is this is a vue problem or something that belongs to vite?
I have the same problem, when I use HTMLInputElement
/ InputHTMLAttributes
:
import { InputHTMLAttributes } from 'vue';
interface Props extends Pick<Partial<InputHTMLAttributes>, 'min' | 'max'> {
value: number;
}
Workaround with /* vue-ignore */
comment works for me:
import { InputHTMLAttributes } from 'vue';
interface Props extends /* @vue-ignore */ Pick<Partial<InputHTMLAttributes>, 'min' | 'max'> {
value: number;
}
I'm getting this same issue with LabelHTMLAttributes
and adding /* vue-ignore */
does nothing. The error persists. Note that this same error does not occur with defineProps
in unplugin-vue-macros, which also supports extending types.