- Add 'force-dynamic' export to API routes using cookies/searchParams - Add 'force-dynamic' export to page components using dynamic features - Create proper error pages without i18n complexity - Fix "Dynamic server usage" errors during static generation Routes now properly marked as dynamic will render at request time instead of failing during build-time static generation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
39 lines
No EOL
1 KiB
TypeScript
39 lines
No EOL
1 KiB
TypeScript
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',
|
|
description: 'Create and theorycraft teams to use in Granblue Fantasy and share with the community',
|
|
}
|
|
|
|
export default async function NewPartyPage() {
|
|
try {
|
|
// Fetch raid groups for the party creation
|
|
const raidGroupsData = await getRaidGroups()
|
|
|
|
return (
|
|
<div className="new-party-page">
|
|
<NewPartyClient
|
|
raidGroups={raidGroupsData.raid_groups || []}
|
|
/>
|
|
</div>
|
|
)
|
|
} catch (error) {
|
|
console.error("Error fetching data for new party page:", error)
|
|
|
|
// Provide empty data for error case
|
|
return (
|
|
<div className="new-party-page">
|
|
<NewPartyClient
|
|
raidGroups={[]}
|
|
error={true}
|
|
/>
|
|
</div>
|
|
)
|
|
}
|
|
} |