Sveltekit error Error: Cannot use relative URL (/api/auth/get-session)

Error: Cannot use relative URL (/api/auth/get-session) with global fetch — use `event.fetch` instead: https://svelte.dev/docs/kit/web-standards#fetch-apis
at globalThis.fetch
Error: Cannot use relative URL (/api/auth/get-session) with global fetch — use `event.fetch` instead: https://svelte.dev/docs/kit/web-standards#fetch-apis
at globalThis.fetch
I think this is related to some update to sveltekit
3 Replies
Silvan
SilvanOP2mo ago
Sorry for some context this used to work fine. its just a simple const session = await authClient.getSession(); actually nvm i downgraded both sk and better-auth and i still get this
Yue
Yue2mo ago
Did you manage to find a solution for this @Silvan ? I'm encountering the exact same issue
Silvan
SilvanOP2mo ago
not a good one yet no the issue is useSession breaks on ssr i just read from page.data atm

Did you find this page helpful?