vue icon indicating copy to clipboard operation
vue copied to clipboard

Augmenting `ComponentCustomOptions` with a function causes `TS2769` when using augmention

Open 6XGate opened this issue 1 year ago • 2 comments

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.

6XGate avatar Apr 25 '23 16:04 6XGate