mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-02-13 12:55:42 +01:00
fix: lazy-load Prisma client to fix build-time URL parsing
- Make Prisma client initialization lazy via Proxy - Defer database-pool import until runtime - Add guard for empty DATABASE_URL - Build now succeeds with Next.js 16.1.4
This commit is contained in:
@@ -8,6 +8,9 @@ import { env } from "./env";
|
||||
// Enhanced connection pool configuration
|
||||
const createConnectionPool = () => {
|
||||
// Parse DATABASE_URL to get connection parameters
|
||||
if (!env.DATABASE_URL) {
|
||||
throw new Error("DATABASE_URL environment variable is required");
|
||||
}
|
||||
const databaseUrl = new URL(env.DATABASE_URL);
|
||||
|
||||
const pool = new Pool({
|
||||
|
||||
Reference in New Issue
Block a user