Vue 3.3.3, defineProps/ defineEmits could not resolve default exported types
Vue version
3.3.3
Link to minimal reproduction
https://github.com/tragid/vue-default-export-error
Steps to reproduce
- Create props interface file: TestComponentProps.ts
- Create default export from file
export default interface TestComponentProps {
msg: string;
}
- import type within component TestComponent.vue
import type TestComponentProps from './TestComponentProps';
const props = defineProps<TestComponentProps>();
- Vue throws error on startup. [@vue/compiler-sfc] Unresolvable type reference or unsupported built-in utility type
What is expected?
Vue can resolve defaultly imported types
What is actually happening?
Vue throws error on startup. [@vue/compiler-sfc] Unresolvable type reference or unsupported built-in utility type
System Info
No response
Any additional comments?
Everything works, if I create export from file with no default provided
export interface TestComponentProps {
msg: string;
}
import type { TestComponentProps } from './TestComponentProps';
const props = defineProps<TestComponentProps>();
@yyx990803 Hi! Fix helped to get rid of compile time errors. Now having runtime errors, when importing default Props and default Emits in a row.
runtime-core.esm-bundler.js:41 [Vue warn]: Property "tag" was accessed during render but is not defined on instance.
at <TestComponent msg="Hello World!" tag="span" onClick=fn<onClick> >
at <App>
I have created a branch with 3.3.4 version with minimal reproduction: https://github.com/tragid/vue-default-export-error/tree/vue-3.3.4