From 6fdfefe88f272d8ebf7e91fa7215fd97f75e97ef Mon Sep 17 00:00:00 2001 From: TerrifiedBug Date: Sat, 7 Mar 2026 13:10:38 +0000 Subject: [PATCH] fix: wrap login page in Suspense boundary for useSearchParams PR #28 added useSearchParams() to the login page for SSO error messages, but Next.js requires a Suspense boundary around components using this hook or static prerendering fails during build. --- src/app/(auth)/login/page.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/app/(auth)/login/page.tsx b/src/app/(auth)/login/page.tsx index 5a4afc75..4de89869 100644 --- a/src/app/(auth)/login/page.tsx +++ b/src/app/(auth)/login/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState, useEffect } from "react"; +import { useState, useEffect, Suspense } from "react"; import { signIn } from "next-auth/react"; import { useRouter, useSearchParams } from "next/navigation"; import { Shield, KeyRound, Loader2 } from "lucide-react"; @@ -25,6 +25,22 @@ const SSO_ERROR_MESSAGES: Record = { }; export default function LoginPage() { + return ( + + + + + + } + > + + + ); +} + +function LoginPageContent() { const router = useRouter(); const searchParams = useSearchParams(); const [email, setEmail] = useState("");