You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clone the reproduction repo git clone https://github.com/iraklisg/mix-ts-vue-script-setup.git
Build the assets npm run dev
What is expected?
To build the assets without errors
What is actually happening?
The following TS error occurs
TS2769: No overload matches this call.
The last overload gave the following error.
Type '(this: void, __props: Readonly<Readonly<LooseRequired<{}>>>, { emit }: { emit: (e: "clicked") => void; expose: any; slots: any; attrs: any; }) => { __sfc: boolean; emit: (e: "clicked") => void; }' is not assignable to type 'SetupFunction<Readonly<LooseRequired<{}>>, { __sfc: boolean; emit: (e: "clicked") => void; }, "clicked"[]>'.
Types of parameters '__1' and 'ctx' are incompatible.
Property 'expose' is missing in type 'SetupContext<"clicked"[]>' but required in type '{ emit: (e: "clicked") => void; expose: any; slots: any; attrs: any; }'.
Defining a type literal to be used as the type of the returned emit function results to an error.
Using the defineEmits macro without returning does not produce errors
// This does not produce errorsdefineEmits<{(e: 'clicked'): void;}>();// This produces errorsconstemit=defineEmits<{(e: 'clicked'): void;}>();constdoSomething=()=>{// ...emit('clicked');};
Version
2.7.5
Reproduction link
github.com
Steps to reproduce
git clone https://github.com/iraklisg/mix-ts-vue-script-setup.git
npm run dev
What is expected?
To build the assets without errors
What is actually happening?
The following TS error occurs
Defining a type literal to be used as the type of the returned emit function results to an error.
Using the
defineEmits
macro without returning does not produce errorsThe assets are build using webpack (laravel-mix)
The text was updated successfully, but these errors were encountered: