- 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>
9 lines
No EOL
282 B
TypeScript
9 lines
No EOL
282 B
TypeScript
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')
|
|
} |