diff --git a/app/[locale]/about/page.tsx b/app/[locale]/about/page.tsx index a4b6c9e9..90a21699 100644 --- a/app/[locale]/about/page.tsx +++ b/app/[locale]/about/page.tsx @@ -1,5 +1,8 @@ import { Metadata } from 'next' import { getTranslations } from 'next-intl/server' + +// Force dynamic rendering to avoid useContext issues during static generation +export const dynamic = 'force-dynamic' import AboutPageClient from './AboutPageClient' export async function generateMetadata({ diff --git a/app/[locale]/new/page.tsx b/app/[locale]/new/page.tsx index ba2554fd..981ece6e 100644 --- a/app/[locale]/new/page.tsx +++ b/app/[locale]/new/page.tsx @@ -2,6 +2,9 @@ import { Metadata } from 'next' import { getRaidGroups } from '~/app/lib/data' import NewPartyClient from './NewPartyClient' +// Force dynamic rendering because getRaidGroups uses cookies +export const dynamic = 'force-dynamic' + // Metadata export const metadata: Metadata = { title: 'Create a new team / granblue.team', diff --git a/app/[locale]/not-found.tsx b/app/[locale]/not-found.tsx index 6d3f6527..ed4b0dc9 100644 --- a/app/[locale]/not-found.tsx +++ b/app/[locale]/not-found.tsx @@ -2,6 +2,9 @@ import { Metadata } from 'next' import { Link } from '~/i18n/navigation' import { getTranslations } from 'next-intl/server' +// Force dynamic rendering to avoid useContext issues during static generation +export const dynamic = 'force-dynamic' + export const metadata: Metadata = { title: 'Page not found / granblue.team', description: 'The page you were looking for could not be found' diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index f7ab15af..8ef9ea9c 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -1,5 +1,8 @@ import { redirect } from 'next/navigation' +// Force dynamic rendering because redirect needs dynamic context +export const dynamic = 'force-dynamic' + export default function HomePage() { // In the App Router, we can use redirect directly in a Server Component redirect('/new') diff --git a/app/[locale]/roadmap/page.tsx b/app/[locale]/roadmap/page.tsx index 76fbb125..a9978259 100644 --- a/app/[locale]/roadmap/page.tsx +++ b/app/[locale]/roadmap/page.tsx @@ -1,5 +1,8 @@ import { Metadata } from 'next' import { getTranslations } from 'next-intl/server' + +// Force dynamic rendering to avoid useContext issues during static generation +export const dynamic = 'force-dynamic' import RoadmapPageClient from './RoadmapPageClient' export async function generateMetadata({ diff --git a/app/[locale]/saved/page.tsx b/app/[locale]/saved/page.tsx index 0ed74e71..317b7859 100644 --- a/app/[locale]/saved/page.tsx +++ b/app/[locale]/saved/page.tsx @@ -4,6 +4,9 @@ import { cookies } from 'next/headers' import { getFavorites, getRaidGroups } from '~/app/lib/data' import SavedPageClient from './SavedPageClient' +// Force dynamic rendering because we use cookies and searchParams +export const dynamic = 'force-dynamic' + // Metadata export const metadata: Metadata = { title: 'Your saved teams / granblue.team', diff --git a/app/[locale]/server-error/page.tsx b/app/[locale]/server-error/page.tsx index 6ef2465f..322410be 100644 --- a/app/[locale]/server-error/page.tsx +++ b/app/[locale]/server-error/page.tsx @@ -1,6 +1,9 @@ import { Metadata } from 'next' import Link from 'next/link' +// Force dynamic rendering to avoid useContext issues during static generation +export const dynamic = 'force-dynamic' + export const metadata: Metadata = { title: 'Server Error / granblue.team', description: 'The server encountered an internal error and was unable to complete your request' diff --git a/app/[locale]/teams/page.tsx b/app/[locale]/teams/page.tsx index bccf7313..fe18bbe3 100644 --- a/app/[locale]/teams/page.tsx +++ b/app/[locale]/teams/page.tsx @@ -3,6 +3,9 @@ import React from 'react' import { getTeams as fetchTeams, getRaidGroups } from '~/app/lib/data' import TeamsPageClient from './TeamsPageClient' +// Force dynamic rendering because we use searchParams +export const dynamic = 'force-dynamic' + // Metadata export const metadata: Metadata = { title: 'Discover teams / granblue.team', diff --git a/app/[locale]/unauthorized/page.tsx b/app/[locale]/unauthorized/page.tsx index 98fff562..ed16f170 100644 --- a/app/[locale]/unauthorized/page.tsx +++ b/app/[locale]/unauthorized/page.tsx @@ -1,6 +1,9 @@ import { Metadata } from 'next' import Link from 'next/link' +// Force dynamic rendering to avoid useContext issues during static generation +export const dynamic = 'force-dynamic' + export const metadata: Metadata = { title: 'Unauthorized / granblue.team', description: "You don't have permission to perform that action" diff --git a/app/[locale]/updates/page.tsx b/app/[locale]/updates/page.tsx index 787607ab..c996ce10 100644 --- a/app/[locale]/updates/page.tsx +++ b/app/[locale]/updates/page.tsx @@ -1,5 +1,8 @@ import { Metadata } from 'next' import { getTranslations } from 'next-intl/server' + +// Force dynamic rendering to avoid useContext issues during static generation +export const dynamic = 'force-dynamic' import UpdatesPageClient from './UpdatesPageClient' export async function generateMetadata({ diff --git a/app/api/jobs/route.ts b/app/api/jobs/route.ts index e759e675..fdef8094 100644 --- a/app/api/jobs/route.ts +++ b/app/api/jobs/route.ts @@ -1,6 +1,9 @@ import { NextRequest, NextResponse } from 'next/server' import { fetchFromApi } from '~/app/lib/api-utils' +// Force dynamic rendering because we use searchParams +export const dynamic = 'force-dynamic' + // GET handler for fetching all jobs export async function GET(request: NextRequest) { try { diff --git a/app/api/jobs/skills/route.ts b/app/api/jobs/skills/route.ts index 8495003f..9d4de849 100644 --- a/app/api/jobs/skills/route.ts +++ b/app/api/jobs/skills/route.ts @@ -1,6 +1,9 @@ import { NextRequest, NextResponse } from 'next/server' import { fetchFromApi } from '~/app/lib/api-utils' +// Force dynamic rendering because fetchFromApi uses cookies +export const dynamic = 'force-dynamic' + // GET handler for fetching all job skills export async function GET(request: NextRequest) { try { diff --git a/app/api/parties/[shortcode]/remix/route.ts b/app/api/parties/[shortcode]/remix/route.ts index 0173bbee..f044795a 100644 --- a/app/api/parties/[shortcode]/remix/route.ts +++ b/app/api/parties/[shortcode]/remix/route.ts @@ -1,6 +1,9 @@ import { NextRequest, NextResponse } from 'next/server'; import { postToApi, revalidate } from '~/app/lib/api-utils'; +// Force dynamic rendering because postToApi uses cookies +export const dynamic = 'force-dynamic'; + // POST handler for remixing a party export async function POST( request: NextRequest, diff --git a/app/api/parties/[shortcode]/route.ts b/app/api/parties/[shortcode]/route.ts index 757fc063..1bee1bdb 100644 --- a/app/api/parties/[shortcode]/route.ts +++ b/app/api/parties/[shortcode]/route.ts @@ -2,6 +2,9 @@ import { NextRequest, NextResponse } from 'next/server'; import { z } from 'zod'; import { fetchFromApi, putToApi, deleteFromApi, revalidate, PartySchema } from '~/app/lib/api-utils'; +// Force dynamic rendering because fetchFromApi uses cookies +export const dynamic = 'force-dynamic'; + // GET handler for fetching a single party by shortcode export async function GET( request: NextRequest, diff --git a/app/api/parties/route.ts b/app/api/parties/route.ts index 4b130a6d..9b8d6fe5 100644 --- a/app/api/parties/route.ts +++ b/app/api/parties/route.ts @@ -2,6 +2,9 @@ import { NextRequest, NextResponse } from 'next/server'; import { z } from 'zod'; import { fetchFromApi, postToApi, PartySchema } from '~/app/lib/api-utils'; +// Force dynamic rendering because we use searchParams and cookies +export const dynamic = 'force-dynamic'; + // GET handler for fetching parties with filters export async function GET(request: NextRequest) { try { diff --git a/app/api/raids/groups/route.ts b/app/api/raids/groups/route.ts index f7697881..62eda8d4 100644 --- a/app/api/raids/groups/route.ts +++ b/app/api/raids/groups/route.ts @@ -1,6 +1,9 @@ import { NextRequest, NextResponse } from 'next/server'; import { fetchFromApi } from '~/app/lib/api-utils'; +// Force dynamic rendering because fetchFromApi uses cookies +export const dynamic = 'force-dynamic'; + // GET handler for fetching raid groups export async function GET(request: NextRequest) { try { diff --git a/app/api/version/route.ts b/app/api/version/route.ts index d16866bd..9f6e9b8c 100644 --- a/app/api/version/route.ts +++ b/app/api/version/route.ts @@ -1,6 +1,9 @@ import { NextRequest, NextResponse } from 'next/server'; import { fetchFromApi } from '~/app/lib/api-utils'; +// Force dynamic rendering because fetchFromApi uses cookies +export const dynamic = 'force-dynamic'; + // GET handler for fetching version info export async function GET(request: NextRequest) { try { diff --git a/app/not-found.tsx b/app/not-found.tsx new file mode 100644 index 00000000..4d8c6a33 --- /dev/null +++ b/app/not-found.tsx @@ -0,0 +1,29 @@ +import { Metadata } from 'next' + +// Force dynamic rendering to avoid issues +export const dynamic = 'force-dynamic' + +export const metadata: Metadata = { + title: 'Page not found / granblue.team', + description: 'The page you were looking for could not be found' +} + +export default function NotFound() { + return ( +
The page you're looking for doesn't exist.
+ ++ {statusCode + ? `A ${statusCode} error occurred on the server.` + : 'An error occurred on the client.'} +
+ + Go Home + +