Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vue 3.3.3, defineProps/ defineEmits runtime errors, when both ComponentProps and ComponentEmits types are default exported #8364

Closed
tragid opened this issue May 18, 2023 · 1 comment · Fixed by #8365

Comments

@tragid
Copy link

tragid commented May 18, 2023

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

  1. Create ComponentProps file with default export
export default interface TestComponentProps {
  msg: string;
}
  1. Create ComponentEmits file with default export
export default interface TestComponentEmits {
  (e: 'click', e: Event): void;
}
  1. Create index.ts file with both exports
export { default as TestComponentProps } from './TestComponentProps';
export { default as TestComponentEmits } from './TestComponentEmits';
  1. 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.

@tragid
Copy link
Author

tragid commented May 29, 2023

@yyx990803 Hi, when is it planned to make 3.3.5 release with this bug fix?

@github-actions github-actions bot locked and limited conversation to collaborators Sep 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant