Fix Vercel build: force dynamic rendering, lazy db init, type fixes
This commit is contained in:
@@ -255,9 +255,12 @@ export default function AdminPage() {
|
||||
{report.targetType === 'post' && report.target && 'content' in report.target && (
|
||||
<button
|
||||
className="btn btn-ghost btn-sm"
|
||||
onClick={() => handlePostAction(report.target.id, report.target.isRemoved ? 'restore' : 'remove')}
|
||||
onClick={() => {
|
||||
const target = report.target as AdminPost;
|
||||
handlePostAction(target.id, target.isRemoved ? 'restore' : 'remove');
|
||||
}}
|
||||
>
|
||||
{report.target.isRemoved ? 'Restore post' : 'Remove post'}
|
||||
{(report.target as AdminPost).isRemoved ? 'Restore post' : 'Remove post'}
|
||||
</button>
|
||||
)}
|
||||
{report.status === 'open' ? (
|
||||
|
||||
@@ -4,6 +4,8 @@ import { useEffect, useState } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
type EnvStatus = {
|
||||
required: Record<string, boolean>;
|
||||
optional: Record<string, boolean>;
|
||||
|
||||
@@ -24,6 +24,10 @@ export const metadata: Metadata = {
|
||||
viewport: "width=device-width, initial-scale=1, maximum-scale=1",
|
||||
};
|
||||
|
||||
// Force all routes to be dynamic (no static generation at build time)
|
||||
// This is appropriate for a social network where all content is user-generated
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
|
||||
Reference in New Issue
Block a user