Skip to content

Commit ce4f2c8

Browse files
committed
DEV: Skip OAuth init during build.
1 parent bb919bc commit ce4f2c8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/hooks.server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { dev } from "$app/environment";
1+
import { building, dev } from "$app/environment";
22
import { paraglideMiddleware } from "$lib/paraglide/server";
33
import { route } from "$lib/ROUTES";
44
import {
@@ -29,6 +29,12 @@ const paraglideHandle: Handle = ({ event, resolve }) =>
2929

3030
// This is called once when the server starts
3131
export const init: ServerInit = async () => {
32+
// Skip OAuth2 initialization during build/prerender to avoid connection errors
33+
if (building) {
34+
hooksLogger.info("Skipping OAuth2 initialization during build process");
35+
return;
36+
}
37+
3238
await connectOAuth2Client();
3339
};
3440

0 commit comments

Comments
 (0)