Vue 3.3.3, defineProps/ defineEmits runtime errors, when both ComponentProps and ComponentEmits types are default exported
Vue version
3.3.4
Link to minimal reproduction
https://github.com/tragid/vue-default-export-error/tree/vue-3.3.4
Steps to reproduce
- Create ComponentProps file with default export
export default interface TestComponentProps {
msg: string;
}
- Create ComponentEmits file with default export
export default interface TestComponentEmits {
(e: 'click', e: Event): void;
}
- Create index.ts file with both exports
export { default as TestComponentProps } from './TestComponentProps';
export { default as TestComponentEmits } from './TestComponentEmits';
- Import them in component with script setup
import type { TestComponentProps, TestComponentEmits } from './types';
const props = defineProps<TestComponentProps>();
const emit = defineEmits<TestComponentEmits>();
What is expected?
No errors in runtime and component is rendered correctly
What is actually happening?
Component not rendering throwing exception
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>
System Info
No response
Any additional comments?
Exporting types without "default" works as expected.