In layout.server.ts
I try to
import type { LayoutServerLoad } from './$types';
but the type can't be found:
'"./$types"' has no exported member named 'LayoutServerLoad'. Did you mean 'LayoutServerData'?
What do I need to do to get the type LayoutServerLoad
(or PageLoad
or PageServerLoad
...) in ./$types
?
+layout.server.ts
(or for another load action, one of the other fixed names, see docs)svelte-kit sync
to generate those files.)tsconfig.json
has to extend .svelte-kit\tsconfig.json
, which defines rootDirs
, so the generated types are resolved. This should already be the case, judging by the suggestion for LayoutServerData
.)For me, just an "npm update" worked.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With