diff --git a/admin/src/app/error.tsx b/admin/src/app/error.tsx
deleted file mode 100644
index 52a619f..0000000
--- a/admin/src/app/error.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-"use client";
-
-import { useEffect } from "react";
-
-export default function Error({
- error,
- reset,
-}: {
- error: Error & { digest?: string };
- reset: () => void;
-}) {
- useEffect(() => {
- // Log the error to an error reporting service
- console.error(error);
- }, [error]);
-
- return (
-
-
Un problème est survenu !
-
- Nous sommes désolés, mais une erreur inattendue s'est produite lors du chargement de cette page.
-
-
-
- );
-}
diff --git a/admin/src/app/global-error.tsx b/admin/src/app/global-error.tsx
deleted file mode 100644
index b905e65..0000000
--- a/admin/src/app/global-error.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-"use client";
-
-export default function GlobalError({
- error,
- reset,
-}: {
- error: Error & { digest?: string };
- reset: () => void;
-}) {
- return (
-
-
-
-
Une erreur critique est survenue !
-
-
-
-
- );
-}
diff --git a/admin/src/app/layout.tsx b/admin/src/app/layout.tsx
index d52db9e..96abb22 100644
--- a/admin/src/app/layout.tsx
+++ b/admin/src/app/layout.tsx
@@ -1,4 +1,5 @@
import type { Metadata } from "next";
+export const dynamic = 'force-dynamic';
import "./globals.css";
diff --git a/admin/src/lib/prisma.ts b/admin/src/lib/prisma.ts
index cfcb4f8..d8d7e4e 100644
--- a/admin/src/lib/prisma.ts
+++ b/admin/src/lib/prisma.ts
@@ -1,18 +1,24 @@
import { PrismaClient } from '@prisma/client'
import { PrismaPg } from '@prisma/adapter-pg'
-// Updated: 2026-05-10T17:21 (Forced reload for OneShotPlan model)
import pg from 'pg'
-const connectionString = process.env.DATABASE_URL!
+const globalForPrisma = globalThis as unknown as { prisma_v4: PrismaClient }
function makePrisma() {
- const pool = new pg.Pool({ connectionString })
+ const connectionString = process.env.DATABASE_URL
+
+ if (!connectionString && process.env.NODE_ENV === 'production') {
+ // If we're in production build and DATABASE_URL is missing,
+ // we return a proxy or a dummy to avoid crashing the build worker
+ // if it just evaluates the module.
+ console.warn("DATABASE_URL is missing. Prisma Client might fail if called.");
+ }
+
+ const pool = new pg.Pool({ connectionString: connectionString || "" })
const adapter = new PrismaPg(pool)
return new PrismaClient({ adapter })
}
-const globalForPrisma = globalThis as unknown as { prisma_v4: PrismaClient }
-
export const prisma = globalForPrisma.prisma_v4 || makePrisma()
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma_v4 = prisma