This is a minor error that doesn't break the app in any way, but I'm happy to contribute a PR to it if it makes sense.
When the User type is passed from Prisma into the AppShell component, it's passed with the hashed password parameter omitted and Typescript isn't sure about it from that point on, especially when AppShell is initialised in the +layout.svelte route later.
I modified +layout.svelte with data?.user explicitly typed
<script lang="ts">
import AppShell from '../../../lib/components/layout/AppShell.svelte';
import type { User } from '@prisma/client';
export let data: { user: User };
</script>
<AppShell user={data?.user}>
<slot />
</AppShell>
It seems to work as before, just without Typescript complaining now.
This is a minor error that doesn't break the app in any way, but I'm happy to contribute a PR to it if it makes sense.
When the
User
type is passed from Prisma into theAppShell
component, it's passed with the hashed password parameter omitted and Typescript isn't sure about it from that point on, especially whenAppShell
is initialised in the+layout.svelte
route later.I modified +layout.svelte with data?.user explicitly typed
It seems to work as before, just without Typescript complaining now.