-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module "@prisma/client" has no exported member "PrismaClient" #13946
Comments
did you ran |
As @arthurfiorette mentioned, I think you're missing a |
I won't raise an Issue, without running the
In most of my Projects, I use |
Installing via
I've run |
I'm having the same issue on endeavourOS. I've run |
I dont't know if it's the Operating System or the Package Manager, I've to use |
Try updating prisma. There apparently was a new major version update. Version 4.1 now. |
Also facing the exact same issue with pnpm and prisma. The Edit: Was using pnpm 7.5.2, upgrading to pnpm 7.8.0, deleting |
As you mentioned, Sir, I updated pnpm to |
Did not fix it for me either. I've also set this in the project's node-linker=hoisted
symlink=false
package-import-method=copy But even that didn't help. |
So, do we know something about this? Still happening, I don't have any types for prisma client. It works when exporting the client from the package base directory. Stops working when exporting from src. I am starting to wonder what the point of pnpm is really |
Hey @irg1008, could you provide us with a simple reproduction? |
Sure, I have a pnpm monorepo with turborepo. Custom client output: generator client {
provider = "prisma-client-js"
output = "../node_modules/.prisma/client" // We need to export the client to the root for production and to pnpm virtual store for development
} So when I disable the custom output, the prisma client is built out to the .pnpm virtual store, and as so it works on both dev and prod in apps "database" is dependency of. The issue is that when doing this, I am missing typing on dev. This happens because the TS server links to the package "database" (without generated prisma client) even when it actually is importing it from the virtual store. Project tree:
The solution to have both the correct build link and typing it's to generate the clients in both places. This causes and immediate problem when updating the schema.You have to generate the client two times, etc etc We can solve this if we automatically output the schema to both node_modules (root and package). Or maybe I am missing some settings with pnpm. Any help would be great! |
A basic fix is to point prisma client output to root node_modules like: generator client {
provider = "prisma-client-js"
output = "../../../node_modules/.prisma/client" // Root of the monorepo
} This works when building and in dev mode. I see problems with this approach while deploying the app as a separate project and not as a monorepo; schema would point to a non existant folder Additional info (.pnpm): auto-install-peers = true
enable-pre-post-scripts=true
public-hoist-pattern[]=*prisma* |
Same issue here - it's searching for it in the wrong location |
@ARMATAV @irg1008 @SooditK @pgiovanni @thasmo Are you by any chance using Have you tried to restart VSCode or the TS Server? There are many issues interleaved, and so far we know my two mentions just above are things we need to fix. Did any of these help? If not, could you please provide us with a small reproduction? We are not able to reproduce the issues mentioned in the comments, so we need your help 🙏 I'd appreciate if you could submit us some code. |
This is how install works for me on Win10: set NODE_OPTIONS="--preserve-symlinks" |
It's been one year have you got the solution? |
Bug description
The latest version of @prisma/client (3.15.2) has (In my opinion) made some changes, and PrismaClient is no longer being exported from "@prisma/client";
How to reproduce
Expected behavior
No response
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: