feat: Add export const dynamic = "force-dynamic" to all main pages to ensure dynamic rendering.

This commit is contained in:
Moh Dzulfikri Maulana
2026-03-09 05:52:31 +07:00
parent e25416f3db
commit 5b45c32109
9 changed files with 18 additions and 0 deletions

View File

@@ -4,6 +4,8 @@ import { format } from "date-fns";
import Link from "next/link";
import { ChevronLeft, Calendar, Clock, Tag as TagIcon, Share2 } from "lucide-react";
export const dynamic = "force-dynamic";
export default async function BlogDetailPage({
params
}: {

View File

@@ -4,6 +4,8 @@ import Link from "next/link";
import { Calendar, Clock, ArrowRight, Tag as TagIcon, Search } from "lucide-react";
import { cn } from "@/lib/utils";
export const dynamic = "force-dynamic";
async function getPublishedBlogs() {
return await prisma.blog.findMany({
where: { status: "PUBLISHED" },

View File

@@ -2,6 +2,8 @@ import { prisma } from "@/lib/prisma";
import { BlogForm } from "@/components/dashboard/blog/BlogForm";
import { notFound } from "next/navigation";
export const dynamic = "force-dynamic";
export default async function EditBlogPage({
params
}: {

View File

@@ -15,6 +15,8 @@ import Link from "next/link";
import { format } from "date-fns";
import { cn } from "@/lib/utils";
export const dynamic = "force-dynamic";
export default async function DashboardBlogPage() {
const blogs = await getBlogs();

View File

@@ -2,6 +2,8 @@ import { prisma } from "@/lib/prisma";
import { ExperienceForm } from "@/components/dashboard/experience/ExperienceForm";
import { notFound } from "next/navigation";
export const dynamic = "force-dynamic";
export default async function EditExperiencePage({
params
}: {

View File

@@ -15,6 +15,8 @@ import Link from "next/link";
import { format } from "date-fns";
import { cn } from "@/lib/utils";
export const dynamic = "force-dynamic";
export default async function DashboardExperiencePage() {
const experiences = await getExperiences();

View File

@@ -12,6 +12,8 @@ import {
} from "lucide-react";
import { cn } from "@/lib/utils";
export const dynamic = "force-dynamic";
async function getStats() {
const [totalVisitors, totalPageViews, recentSessions] = await Promise.all([
prisma.session.count(),

View File

@@ -2,6 +2,8 @@ import { prisma } from "@/lib/prisma";
import { ProjectForm } from "@/components/dashboard/projects/ProjectForm";
import { notFound } from "next/navigation";
export const dynamic = "force-dynamic";
export default async function EditProjectPage({
params
}: {

View File

@@ -14,6 +14,8 @@ import {
import Link from "next/link";
import { cn } from "@/lib/utils";
export const dynamic = "force-dynamic";
export default async function DashboardProjectsPage() {
const projects = await getProjects();