From 93f7061c5373e150e0834c52cb2d54de8f5b6632 Mon Sep 17 00:00:00 2001 From: claude Date: Tue, 12 May 2026 14:52:47 +0000 Subject: [PATCH] fix: resolve build failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix TypeScript type error in deleteInvoice server action (returned {message: string} instead of void, incompatible with form action type) - Add export const dynamic = "force-dynamic" to dashboard pages that make DB calls at build time (/dashboard, /dashboard/invoices, /dashboard/invoices/create) to prevent failed static prerendering - Fix import order in customers/page.tsx (export before import was invalid) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- app/dashboard/(overview)/page.tsx | 2 ++ app/dashboard/customers/page.tsx | 8 ++++---- app/dashboard/invoices/create/page.tsx | 2 ++ app/dashboard/invoices/page.tsx | 2 ++ app/lib/actions.ts | 7 ++----- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/dashboard/(overview)/page.tsx b/app/dashboard/(overview)/page.tsx index 13acd308..87ddcd44 100644 --- a/app/dashboard/(overview)/page.tsx +++ b/app/dashboard/(overview)/page.tsx @@ -10,6 +10,8 @@ import { RevenueChartSkeleton, } from "@/app/ui/skeletons"; +export const dynamic = "force-dynamic"; + export const metadata: Metadata = { title: "Dashboard", }; diff --git a/app/dashboard/customers/page.tsx b/app/dashboard/customers/page.tsx index 60071ea9..91027ed0 100644 --- a/app/dashboard/customers/page.tsx +++ b/app/dashboard/customers/page.tsx @@ -1,9 +1,9 @@ -export default function Page() { - return

Customers Page

; -} - import type { Metadata } from "next"; export const metadata: Metadata = { title: "Customers", }; + +export default function Page() { + return

Customers Page

; +} diff --git a/app/dashboard/invoices/create/page.tsx b/app/dashboard/invoices/create/page.tsx index 160ddff3..c2bf07eb 100644 --- a/app/dashboard/invoices/create/page.tsx +++ b/app/dashboard/invoices/create/page.tsx @@ -3,6 +3,8 @@ import { fetchCustomers } from "@/app/lib/data"; import Breadcrumbs from "@/app/ui/invoices/breadcrumbs"; import Form from "@/app/ui/invoices/create-form"; +export const dynamic = "force-dynamic"; + export const metadata: Metadata = { title: "Create invoices", }; diff --git a/app/dashboard/invoices/page.tsx b/app/dashboard/invoices/page.tsx index 5516268a..0efe5521 100644 --- a/app/dashboard/invoices/page.tsx +++ b/app/dashboard/invoices/page.tsx @@ -8,6 +8,8 @@ import Table from "@/app/ui/invoices/table"; import Search from "@/app/ui/search"; import { InvoicesTableSkeleton } from "@/app/ui/skeletons"; +export const dynamic = "force-dynamic"; + export const metadata: Metadata = { title: "Invoices", }; diff --git a/app/lib/actions.ts b/app/lib/actions.ts index f08093f1..35bfbf0f 100644 --- a/app/lib/actions.ts +++ b/app/lib/actions.ts @@ -103,7 +103,7 @@ export async function updateInvoice( redirect("/dashboard/invoices"); } -export async function deleteInvoice(id: string) { +export async function deleteInvoice(id: string): Promise { // throw new Error('Failed to Delete Invoice. ') try { await sql` @@ -111,11 +111,8 @@ export async function deleteInvoice(id: string) { WHERE id = ${id} `; revalidatePath("/dashboard/invoices"); - return { message: "Deleted Invoice. " }; } catch (_error) { - return { - message: "Database Error: Failed while deleting record from Invoice. ", - }; + console.error("Database Error: Failed while deleting record from Invoice."); } }