Skip to content

v3.3 extending imported Props from alias-imported component throws compiler-error #8348

Closed
@thomasaull

Description

@thomasaull

Vue version

3.3.2

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-gym3of?file=src%2Fcomponents%2FParentComp.vue

Steps to reproduce

Open the reproduction link, in the file ParentComp.vue are three different imports:

  1. Import Props from ts file with alias path: '@/components/SomeTypes.ts'
  2. Import Props from Vue component with relative import: ./ChildComp.vue'
  3. Import Props from Vue component with alias path: '@/components/ChildComp.vue'

By commenting/uncommenting the appropriate lines each import can be tested one by one.

What is expected?

1, 2, and 3 should work

What is actually happening?

While 1 and 2 work, 3 throws an error:

[plugin:vite:vue] [@vue/compiler-sfc] Failed to resolve extends base type.
If this previously worked in 3.2, you can instruct the compiler to ignore this extend by adding /* @vue-ignore */ before it, for example:

interface Props extends /* @vue-ignore */ Base {}

Note: both in 3.2 or with the ignore, the properties in the base type are treated as fallthrough attrs at runtime.

The culprit seems to be the combination of:

  • Importing from a Vue component
  • Importing with alias-path

By removing one of the two the errors does not get thrown.

System Info

No response

Any additional comments?

No response

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