Next.js Discord

Discord Forum

Prisma error in my nextjs project

Unanswered
Alligator mississippiensis posted this in #help-forum
Open in Discord
Alligator mississippiensisOP
I'm building this project with nextjs, prisma and postgresql hosted on railway and each time I build my application I get this error :
npm run build

chickenspot@0.1.0 build
next build

â–² Next.js 14.0.4
- Environments: .env

✓ Creating an optimized production build
✓ Compiled successfully
✓ Linting and checking validity of types
✓ Collecting page data
Generating static pages (1/8) [== ]
[Function: addToCart]
Generating static pages (7/8) [= ]

Error occurred prerendering page "/api/inventory". Read more: https://nextjs.org/docs/messages/prerender-error
PrismaClientInitializationError:
Invalid prisma.inventory.findMany() invocation:


Can't reach database server at viaduct.proxy.rlwy.net:26918

Please make sure your database server is running at viaduct.proxy.rlwy.net:26918.
at si.handleRequestError (/home/ubuntu/Projects/chickenspot/node_modules/@prisma/client/runtime/library.js:125:7117)
at si.handleAndLogRequestError (/home/ubuntu/Projects/chickenspot/node_modules/@prisma/client/runtime/library.js:125:6151)
at si.request (/home/ubuntu/Projects/chickenspot/node_modules/@prisma/client/runtime/library.js:125:5859)
at async l (/home/ubuntu/Projects/chickenspot/node_modules/@prisma/client/runtime/library.js:130:9805)
at async p (/home/ubuntu/Projects/chickenspot/.next/server/app/api/inventory/route.js:1:530)
at async /home/ubuntu/Projects/chickenspot/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:419
✓ Generating static pages (8/8)

Export encountered errors on following paths:
/api/inventory/route: /api/inventory

I don't know what the problem is or how to solve it.

0 Replies