-
-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Labels
questionA user questionA user question
Description
Describe the bug
In +page.ts and +page.server.ts files, the type for load events does not get inferred.
According to https://svelte.dev/blog/zero-config-type-safety , I should not need to explicitly type the parameter of the exported load function in said files.
Reproduction
Create any API route, e.g src/routes/+page.server.ts, and add a load function to the file, like below:
export async function load(event) { // ERROR: Parameter 'event' implicitly has an 'any' type.
const { fetch } = event;
const response = await fetch(/* ... */);
return await response.json();
}Expected behaviour
The type of the event parameter in the function below should be inferred.
export async function load(event) {
const { fetch } = event; // <-- type of fetch should be automatically inferred.
// ...
}System Info
- OS: Fedora 37
- IDE: NeoVim using Mason and svelte-language-server@0.15.8
Which package is the issue about?
svelte-language-server
Additional Information, eg. Screenshots
No response
Metadata
Metadata
Assignees
Labels
questionA user questionA user question