-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Description
Describe the bug
Typescript throws error when using an async function in $effect since it expects a void function
Reproduction
$effect(async () => {
let res = await fetch(location.href, {
method: 'POST',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({action: 'validatemail', email})
});
error = await res.json();
});
Logs
Svelte: Argument of type () => Promise<void> is not assignable to parameter of type () => void | (() => void)
Type Promise<void> is not assignable to type void | (() => void)
System Info
@next.85
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels