Version
2.7.5
Reproduction link
github.com
Steps to reproduce
- 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 errors
defineEmits<{
(e: 'clicked'): void;
}>();
// This produces errors
const emit = defineEmits<{
(e: 'clicked'): void;
}>();
const doSomething = () => {
// ...
emit('clicked');
};
The assets are build using webpack (laravel-mix)
- Laravel Mix Version: 6.0.49
- Node Version: 18.1.0
- NPM Version: 8.8.0:
- OS: Linux
Version
2.7.5
Reproduction link
github.com
Steps to reproduce
git clone https://github.com/iraklisg/mix-ts-vue-script-setup.gitnpm run devWhat 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
defineEmitsmacro without returning does not produce errorsThe assets are build using webpack (laravel-mix)