edgedb-js
edgedb-js copied to clipboard
@gel/auth-sveltekit with redirect Error & solution
This issue primarily helps users of @gel/auth-sveltekit with the latest Svelte 5 version, where they may encounter a problem with the built-in Auth UI failing to redirect in preview or production environments:
Error: {"status":307,"location":"http://localhost:10708/db/main/ext/auth/ui/signin?challenge=jkG6CY6kq4y2FzbrJpVM9dN1qPIOG1lQMtmxSoDk-3c"}
The root cause is that SvelteKit cannot determine whether this thrown error is of the Redirect type. For reference: https://svelte.dev/docs/kit/@sveltejs-kit#isRedirect.
As a temporary workaround, you can consider locally importing the entire package and converting it to a TypeScript file. This will resolve the issue for now and also allow you to customize additional logic more easily.
Hope this saves others some time if they run into the same problem! 希望遇到同样问题的朋友可以少花时间在这里~