Skip to content

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

@tragid

Description

@tragid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy