Fixes and add prisma accelerate

This commit is contained in:
MartinBraquet
2025-07-29 04:24:49 +02:00
parent f113fb3cba
commit 0f0f0a7e5f
4 changed files with 834 additions and 99 deletions

View File

@@ -73,6 +73,8 @@ export default function Post() {
src={image}
alt={profile.name || 'Profile picture'}
className="h-full w-full object-cover"
width={200}
height={200}
// onError={(e) => {
// const target = e.target as HTMLImageElement;
// target.onerror = null;

View File

@@ -1,4 +1,5 @@
import { PrismaClient } from "@prisma/client";
import { withAccelerate } from '@prisma/extension-accelerate'
const globalForPrisma = global as unknown as { prisma: PrismaClient };
@@ -6,6 +7,6 @@ export const prisma =
globalForPrisma.prisma ||
new PrismaClient({
log: ["query"],
});
}).$extends(withAccelerate());
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;

924
package-lock.json generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -4,10 +4,10 @@
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"postinstall": "npx prisma generate --no-engine",
"build": "npx prisma migrate deploy && next build",
"start": "next start",
"lint": "next lint",
"postinstall": "npx prisma generate --no-engine"
"lint": "next lint"
},
"dependencies": {
"@auth/prisma-adapter": "^2.10.0",