Skip to content

vue-tsc complains when exporting additional TS types from SFC #923

@theoephraim

Description

@theoephraim

In version 0.29.8, I was able to export additional types from my SFCs without any issues, while in version 0.31.1, everything works fine in VSCode, but when I run vue-tsc, I get errors like the following:

Module '"@/common/components/general/Icon/Icon.vue"' has no exported member 'IconNames'. Did you mean to use 'import IconNames from "@/common/components/general/Icon/Icon.vue"' instead?

(I'm not positive about the versions in between)

To clarify, in my component Icon.vue, I may be exporting additional types to use in other components. For example:

export type IconNames = 'arrow' | 'check' | 'x' | ...;
...
const props = defineProps({
  name: { type: String as PropType<IconNames>, required: true },
  ...
});
...

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