Skip to content

The components option in Mixins cant be inferred #13253

Open
@Hadakajime

Description

@Hadakajime

Vue version

3.5.13

Link to minimal reproduction

https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgEwKYDNgDtUGELgQ5bwC+c6UBcARAG4CuqNA3AFBsDGRAzvLgAtgAG2RwAvCgzY8BSMRgAKBKQCU7Lr3ghgAD2wTEbAJDdCCngC4jx44JHIANCdLPSG7lj5x84AIyGaJg4vvKoJMomWACGIKjWNAAK0VDhMKFEaTTOxjr6XtYA2ia5etg5ALpu6hye3qEATIHSIXKZEQhscN1wZmEkVkY9wz5Cos7DpGxqGqF+AHR97TA8APzz9qLsAPTbI-sjAHqrbI2LbRbrm8g7ewf3x0A

Steps to reproduce

create 3 components:

  1. a child component that will be included inside the mixin
  2. a mixin
  3. a parent component that will use the mixin

when you edit the parent component, the instance of within the template does not receive any coloration or autocomplete, such as for the required value: string prop. In the linked example, the type inference is resolved as:

Component<any, any, any, ComputedOptions, MethodOptions, {}, any>

everything does still compile and executes correctly at runtime, though

What is expected?

components registered inside a mixin should have their definitions recognised in the parent components that import the mixin.

What is actually happening?

the mixin's components are colored like native elements in the parent component's template, and there is no component-specific autocomplete options available. The inferred types for those components' properties are any or generic defaults

System Info

Windows 11 with WSL to Ubuntu 24

Edition	Windows 11 Business
Version	24H2
Installed on	‎2025-‎02-‎24
OS build	26100.3775
Experience	Windows Feature Experience Pack 1000.26100.66.0

System:
    OS: Linux 5.15 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
    CPU: (16) x64 AMD Ryzen 7 7745HX with Radeon Graphics
    Memory: 27.47 GB / 31.19 GB
    Container: Yes
    Shell: 5.2.21 - /bin/bash
  Binaries:
    Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v22.12.0/bin/yarn
    npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
    pnpm: 10.6.3 - ~/.local/share/pnpm/pnpm

Any additional comments?

Originally reported here:
vuejs/language-tools#5342

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions