fix csr nextjs build error
https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout
This commit is contained in:
@@ -4,11 +4,18 @@ import { Button } from "@/components/ui/button"
|
|||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
import { useSearchParams } from "next/navigation"
|
import { useSearchParams } from "next/navigation"
|
||||||
|
import { Suspense } from "react"
|
||||||
|
|
||||||
export default function AuthErrorPage() {
|
function Search() {
|
||||||
const searchParams = useSearchParams()
|
const searchParams = useSearchParams()
|
||||||
const errorMessage = searchParams.get('error')
|
const errorMessage = searchParams.get('error')
|
||||||
|
|
||||||
|
return (<div className="text-center p-3 bg-background rounded-lg">
|
||||||
|
{errorMessage}
|
||||||
|
</div>)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function AuthErrorPage() {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen flex items-center justify-center bg-background p-4">
|
<div className="min-h-screen flex items-center justify-center bg-background p-4">
|
||||||
<Card className="w-full max-w-md bg-red-400 dark:bg-red-600">
|
<Card className="w-full max-w-md bg-red-400 dark:bg-red-600">
|
||||||
@@ -16,9 +23,9 @@ export default function AuthErrorPage() {
|
|||||||
<CardTitle className="text-2xl font-bold">Error</CardTitle>
|
<CardTitle className="text-2xl font-bold">Error</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="space-y-4">
|
<CardContent className="space-y-4">
|
||||||
<div className="text-center p-3 bg-background rounded-lg">
|
<Suspense>
|
||||||
{errorMessage}
|
<Search />
|
||||||
</div>
|
</Suspense>
|
||||||
<div className="flex flex-row">
|
<div className="flex flex-row">
|
||||||
<Button variant="secondary" asChild>
|
<Button variant="secondary" asChild>
|
||||||
<Link href="/">Go back to Homepage</Link>
|
<Link href="/">Go back to Homepage</Link>
|
||||||
|
|||||||
Reference in New Issue
Block a user