Skip to content

Augmenting ComponentCustomOptions with a function causes TS2769 when using augmention #13009

Open
@6XGate

Description

Version

2.7.14

Reproduction link

github.com

Steps to reproduce

  1. Augment the ComponentCustomOptions interface with a new optional member function. Example: funcOption?: (...) => ....
  2. Use the new member function in defineComponent. Example defineComponent({ name: 'CompName', funcOption: (...) => ... }).
  3. Run a build with type-checking. Example: npm run build with vite and vue-tsc installed and setup.

Using the repro link:

  1. Clone the repo
  2. Run npm ci
  3. Run npm run build

What is expected?

That the build would succeed without error.

What is actually happening?

A TS2769 error results when built. It seems TypeScript is attempting to use the functional component overload rather than one of the normal overloads.

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