404 Error for /api/auth/sign-up

When attempting to access the sign-up endpoint via /api/auth/sign-up/email, the SvelteKit app throws a 404 error:

SvelteKitError: Not found: /api/auth/sign-up/email
    at resolve (/home/ubuntu/v2/frontend/node_modules/@sveltejs/kit/src/runtime/server/respond.js:582:13)
    at /home/ubuntu/v2/frontend/node_modules/@sveltejs/kit/src/runtime/server/respond.js:370:7
    at AsyncLocalStorage.run (node:async_hooks:346:14)
    at with_event (/home/ubuntu/v2/frontend/node_modules/@sveltejs/kit/src/runtime/app/server/event.js:49:20)
    at resolve (/home/ubuntu/v2/frontend/node_modules/@sveltejs/kit/src/runtime/server/respond.js:369:6)
    at svelteKitHandler (file:///home/ubuntu/v2/frontend/node_modules/better-auth/dist/integrations/svelte-kit.mjs:18:10)
    at async respond (/home/ubuntu/v2/frontend/node_modules/@sveltejs/kit/src/runtime/server/respond.js:363:20)
    at async file:///home/ubuntu/v2/frontend/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:521:22


/home/ubuntu/v2/frontend/src/hooks.server.ts

import { auth } from "$lib/auth"; 
import { svelteKitHandler } from "better-auth/svelte-kit";
 
export async function handle({ event, resolve }) {
    if (
        event.url.pathname.startsWith(
            '/.well-known/appspecific/com.chrome.devtools'
        )
    ) {
        return new Response(null, { status: 204 }); // Return empty response with 204 No Content
    }

    return svelteKitHandler({ event, resolve, auth });
}


import { createAuthClient } from "better-auth/svelte"


export const authClient = createAuthClient({
    baseURL: "https://sub.domain.de"
});
  



does anyone have an idea why this happens?
Was this page helpful?