I'm very new to sveltkit. Just followed supabase-svelte
app refered to this link. The supabased examples work good as it says.
Now I tried another things like routing reffering the official doc. It seems pretty easy and simple but not working for me.
This is my src structure
and the +page.svelte
:
<h1>About this site</h1><p>TODO...</p><a href="/">Home</a>
And when I access to http://localhost:5173/about
, it just seems main App.svelte
.
This is my App.svelte
just same as supabase-svelte
app.
<script lang="ts"> import { onMount } from 'svelte' import { supabase } from './supabaseClient' import type { AuthSession } from '@supabase/supabase-js' import Account from './lib/Account.svelte' import Auth from './lib/Auth.svelte' let session: AuthSession | null onMount(() => { supabase.auth.getSession().then(({ data }) => { session = data.session }) supabase.auth.onAuthStateChange((_event, _session) => { session = _session }) })</script><div class="container" style="padding: 50px 0 100px 0"> {#if !session}<Auth /> {:else}<Account {session} /> {/if}</div>
I googled a lot, but coudln't find anything helpful..