2026-01-30 13:41:32 +01:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
|
|
import { useEffect } from 'react'
|
|
|
|
|
import Link from 'next/link'
|
|
|
|
|
import { Button } from '@/components/ui/button'
|
|
|
|
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
|
|
|
|
import { AlertTriangle, RefreshCw, Home } from 'lucide-react'
|
Performance optimization, applicant portal, and missing DB migration
Performance:
- Convert admin dashboard from SSR to client-side tRPC (fixes 503/ChunkLoadError)
- New dashboard.getStats tRPC endpoint batches 16 queries into single response
- Parallelize jury dashboard queries (assignments + gracePeriods via Promise.all)
- Add project.getFullDetail combined endpoint (project + assignments + stats)
- Configure Prisma connection pool (connection_limit=20, pool_timeout=10)
- Add optimizePackageImports for lucide-react tree-shaking
- Increase React Query staleTime from 1min to 5min
Applicant portal:
- Add applicant layout, nav, dashboard, documents, team, and mentor pages
- Add applicant router with document and team management endpoints
- Add chunk error recovery utility
- Update role nav and auth redirect for applicant role
Database:
- Add migration for missing schema elements (SpecialAward job tracking
columns, WizardTemplate table, missing indexes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:04:26 +01:00
|
|
|
import { isChunkLoadError, attemptChunkErrorRecovery } from '@/lib/chunk-error-recovery'
|
2026-01-30 13:41:32 +01:00
|
|
|
|
|
|
|
|
export default function PublicError({
|
|
|
|
|
error,
|
|
|
|
|
reset,
|
|
|
|
|
}: {
|
|
|
|
|
error: Error & { digest?: string }
|
|
|
|
|
reset: () => void
|
|
|
|
|
}) {
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
console.error('Public section error:', error)
|
Performance optimization, applicant portal, and missing DB migration
Performance:
- Convert admin dashboard from SSR to client-side tRPC (fixes 503/ChunkLoadError)
- New dashboard.getStats tRPC endpoint batches 16 queries into single response
- Parallelize jury dashboard queries (assignments + gracePeriods via Promise.all)
- Add project.getFullDetail combined endpoint (project + assignments + stats)
- Configure Prisma connection pool (connection_limit=20, pool_timeout=10)
- Add optimizePackageImports for lucide-react tree-shaking
- Increase React Query staleTime from 1min to 5min
Applicant portal:
- Add applicant layout, nav, dashboard, documents, team, and mentor pages
- Add applicant router with document and team management endpoints
- Add chunk error recovery utility
- Update role nav and auth redirect for applicant role
Database:
- Add migration for missing schema elements (SpecialAward job tracking
columns, WizardTemplate table, missing indexes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:04:26 +01:00
|
|
|
|
|
|
|
|
if (isChunkLoadError(error)) {
|
|
|
|
|
attemptChunkErrorRecovery('public')
|
|
|
|
|
}
|
2026-01-30 13:41:32 +01:00
|
|
|
}, [error])
|
|
|
|
|
|
Performance optimization, applicant portal, and missing DB migration
Performance:
- Convert admin dashboard from SSR to client-side tRPC (fixes 503/ChunkLoadError)
- New dashboard.getStats tRPC endpoint batches 16 queries into single response
- Parallelize jury dashboard queries (assignments + gracePeriods via Promise.all)
- Add project.getFullDetail combined endpoint (project + assignments + stats)
- Configure Prisma connection pool (connection_limit=20, pool_timeout=10)
- Add optimizePackageImports for lucide-react tree-shaking
- Increase React Query staleTime from 1min to 5min
Applicant portal:
- Add applicant layout, nav, dashboard, documents, team, and mentor pages
- Add applicant router with document and team management endpoints
- Add chunk error recovery utility
- Update role nav and auth redirect for applicant role
Database:
- Add migration for missing schema elements (SpecialAward job tracking
columns, WizardTemplate table, missing indexes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:04:26 +01:00
|
|
|
const isChunk = isChunkLoadError(error)
|
|
|
|
|
|
2026-01-30 13:41:32 +01:00
|
|
|
return (
|
|
|
|
|
<div className="flex min-h-[50vh] items-center justify-center p-4">
|
|
|
|
|
<Card className="max-w-md">
|
|
|
|
|
<CardHeader className="text-center">
|
|
|
|
|
<div className="mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-destructive/10">
|
|
|
|
|
<AlertTriangle className="h-6 w-6 text-destructive" />
|
|
|
|
|
</div>
|
|
|
|
|
<CardTitle>Something went wrong</CardTitle>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4 text-center">
|
|
|
|
|
<p className="text-muted-foreground">
|
Performance optimization, applicant portal, and missing DB migration
Performance:
- Convert admin dashboard from SSR to client-side tRPC (fixes 503/ChunkLoadError)
- New dashboard.getStats tRPC endpoint batches 16 queries into single response
- Parallelize jury dashboard queries (assignments + gracePeriods via Promise.all)
- Add project.getFullDetail combined endpoint (project + assignments + stats)
- Configure Prisma connection pool (connection_limit=20, pool_timeout=10)
- Add optimizePackageImports for lucide-react tree-shaking
- Increase React Query staleTime from 1min to 5min
Applicant portal:
- Add applicant layout, nav, dashboard, documents, team, and mentor pages
- Add applicant router with document and team management endpoints
- Add chunk error recovery utility
- Update role nav and auth redirect for applicant role
Database:
- Add migration for missing schema elements (SpecialAward job tracking
columns, WizardTemplate table, missing indexes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:04:26 +01:00
|
|
|
{isChunk
|
|
|
|
|
? 'A new version of the platform may have been deployed. Please reload the page.'
|
|
|
|
|
: 'An error occurred while loading this page. Please try again or return to the home page.'}
|
2026-01-30 13:41:32 +01:00
|
|
|
</p>
|
|
|
|
|
<div className="flex justify-center gap-2">
|
Performance optimization, applicant portal, and missing DB migration
Performance:
- Convert admin dashboard from SSR to client-side tRPC (fixes 503/ChunkLoadError)
- New dashboard.getStats tRPC endpoint batches 16 queries into single response
- Parallelize jury dashboard queries (assignments + gracePeriods via Promise.all)
- Add project.getFullDetail combined endpoint (project + assignments + stats)
- Configure Prisma connection pool (connection_limit=20, pool_timeout=10)
- Add optimizePackageImports for lucide-react tree-shaking
- Increase React Query staleTime from 1min to 5min
Applicant portal:
- Add applicant layout, nav, dashboard, documents, team, and mentor pages
- Add applicant router with document and team management endpoints
- Add chunk error recovery utility
- Update role nav and auth redirect for applicant role
Database:
- Add migration for missing schema elements (SpecialAward job tracking
columns, WizardTemplate table, missing indexes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:04:26 +01:00
|
|
|
{isChunk ? (
|
|
|
|
|
<Button onClick={() => window.location.reload()}>
|
|
|
|
|
<RefreshCw className="mr-2 h-4 w-4" />
|
|
|
|
|
Reload Page
|
|
|
|
|
</Button>
|
|
|
|
|
) : (
|
|
|
|
|
<>
|
|
|
|
|
<Button onClick={reset} variant="outline">
|
|
|
|
|
<RefreshCw className="mr-2 h-4 w-4" />
|
|
|
|
|
Try Again
|
|
|
|
|
</Button>
|
|
|
|
|
<Button asChild>
|
|
|
|
|
<Link href="/">
|
|
|
|
|
<Home className="mr-2 h-4 w-4" />
|
|
|
|
|
Home
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
</>
|
|
|
|
|
)}
|
2026-01-30 13:41:32 +01:00
|
|
|
</div>
|
Performance optimization, applicant portal, and missing DB migration
Performance:
- Convert admin dashboard from SSR to client-side tRPC (fixes 503/ChunkLoadError)
- New dashboard.getStats tRPC endpoint batches 16 queries into single response
- Parallelize jury dashboard queries (assignments + gracePeriods via Promise.all)
- Add project.getFullDetail combined endpoint (project + assignments + stats)
- Configure Prisma connection pool (connection_limit=20, pool_timeout=10)
- Add optimizePackageImports for lucide-react tree-shaking
- Increase React Query staleTime from 1min to 5min
Applicant portal:
- Add applicant layout, nav, dashboard, documents, team, and mentor pages
- Add applicant router with document and team management endpoints
- Add chunk error recovery utility
- Update role nav and auth redirect for applicant role
Database:
- Add migration for missing schema elements (SpecialAward job tracking
columns, WizardTemplate table, missing indexes)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:04:26 +01:00
|
|
|
{!isChunk && error.digest && (
|
2026-01-30 13:41:32 +01:00
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
Error ID: {error.digest}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|