Can´t generate prisma global next.js 15.5.6 (Next.js-supabase-prisma)
Hi everyone,
I am trying to start up a new app with the following stack:
Next.js: 15.5.6
Database: Supabase
ORM: Prisma Client 6.18.0
#Explanation of setup
I have my own project (not following the full “create-next-app” guide). I have been following the Prisma Next.js guide:
https://www.prisma.io/docs/guides/nextjs
In this guide it doesn´t say to run
#Files
Prisma.config
Schema.prisma
What I want
I wan´t to be able to import prismaclient as instructed and be able to have a global instance of it. But when I do this:
I get the following error:
I have once cleared my DB, uninstalled prisma, deleted everything and set up everything again... But get the same error.
I would like some guidance or more question to help me figure things out..
Thanks in advanded
How to use Prisma ORM and Prisma Postgres with Next.js 15 and Verce...
Learn how to use Prisma ORM in a Next.js app and deploy it to Vercel
Solution:Jump to solution
Solution
In the prisma.schema file, changed provider
from: "prisma-client"
to: "prisma-client-js"
...
7 Replies
You've gone full bot mode! Let me fetch that AI answer for you ASAP.
Your error:
means the Prisma Client was not generated at the expected output path. This is a common issue if you haven't run
After editing your
Your import should match the output path. If your output is
Exclude the generated client from version control: [Getting started] 4. Automate generation:
Add a script to your
You must run
npx prisma generate after setting up your schema and generator output path.
Key steps to resolve:
1. Run prisma generate:After editing your
schema.prisma, you must run:
This will generate the client in generated/prisma as specified in your generator block. This step is required every time you change your schema or generator config. The official docs and community threads confirm this is necessary, even if not always explicitly stated in every guide [Generating Prisma Client].
2. Check your import path:Your import should match the output path. If your output is
../generated/prisma relative to prisma/schema.prisma, then from your app code (e.g., src/lib/prisma.ts), the import should be:
Make sure your tsconfig.json has the correct path alias for @/generated/prisma.
3. Add to .gitignore:Exclude the generated client from version control: [Getting started] 4. Automate generation:
Add a script to your
package.json to ensure the client is generated after install:
[Module '"@prisma/client"' has no exported member 'PrismaClient']
Summary:You must run
npx prisma generate after setting up your schema and generator. This will create the client at the specified output path, resolving the import error. If you still have issu
es, double-check your paths and that the generated folder exists.
If you follow these steps and still see the error, please share your project structure and the exact location of your import statement.
🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly.
In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.Project structure:
root/prisma/migrations
root/prisma/prisma.schema
root/lib/prisma.ts
root/generated/prisma
Files inside /primsa (IMG)
I have tried the following imports in prisma.ts
import { PrismaClient } from "@/generated/prisma"; Error → *signUpWithProvider Cannot find module '@/generated/prisma' or its corresponding type declarations.ts(2307)import { PrismaClient } from "@prisma/client";

I
try this schema
run
prisma generate
then import the prisma client like this
import { PrismaClient } from "../prisma/generated/client"
@oscarthroedssonyou need to add a path alias for prisma if you dont want to use relative import
Add a path in tsconfig

Thanx for tips. The only thing that worked was using a provider as: ”prisma-client-js”
Solution
Solution
In the prisma.schema file, changed provider
from: "prisma-client"
to: "prisma-client-js"
This is my Prisma files:
schema.prisma
prisma.config.ts
/lib/prisma.ts