Module '"@prisma/client"' has no exported member 'PrismaClient'.ts(2305)
See original GitHub issueBug description
I tried to use pnpm in my proj but it seems it does not work
I see this two issues too but none of them helped:
How to reproduce
- Clone the repo: https://github.com/kasir-barati/basic-prisma-nestjs-restful-api
pnpm install
pnpm prisma generate
- open
src/shared/modules/prisma/prisma.service.ts
- See error
Expected behavior
No error just import PrismaClient
Prisma information
See repo
Environment & setup
- OS:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
- Database: PostgreSQL
- Node.js version: v16.15.0
Prisma Version
$ pnpm prisma -v
prisma : 3.14.0
@prisma/client : 3.14.0
Current platform : debian-openssl-1.1.x
Query Engine (Node-API) : libquery-engine 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/.pnpm/@prisma+engines@3.14.0-36.2b0c12756921c891fec4f68d9444e18c7d5d4a6a/node_modules/@prisma/engines/libquery_engine-debian-openssl-1.1.x.so.node)
Migration Engine : migration-engine-cli 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/.pnpm/@prisma+engines@3.14.0-36.2b0c12756921c891fec4f68d9444e18c7d5d4a6a/node_modules/@prisma/engines/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/.pnpm/@prisma+engines@3.14.0-36.2b0c12756921c891fec4f68d9444e18c7d5d4a6a/node_modules/@prisma/engines/introspection-engine-debian-openssl-1.1.x)
Format Binary : prisma-fmt 2b0c12756921c891fec4f68d9444e18c7d5d4a6a (at node_modules/.pnpm/@prisma+engines@3.14.0-36.2b0c12756921c891fec4f68d9444e18c7d5d4a6a/node_modules/@prisma/engines/prisma-fmt-debian-openssl-1.1.x)
Default Engines Hash : 2b0c12756921c891fec4f68d9444e18c7d5d4a6a
Studio : 0.460.0
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:24 (6 by maintainers)
Top Results From Across the Web
"'node_modules/@prisma/client' has no exported member ...
I manually deleted node_modules/.prisma directory. again followed steps 2 and 3. Now I started seeing this problem: error TS2305: Module '"../.
Read more >Error importing PrismaClient in code compiled from typescript ...
The requested module '@prisma/client' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can ...
Read more >Module '"@prismicio/client"' has no exported member 'Content'
As title states, I'm getting this error: This is my prismic.ts: import * as prismic from '@prismicio/client'; import * as prismicNext from ...
Read more >@prisma/client | Yarn - Package Manager
Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports MySQL, PostgreSQL ...
Read more >Prisma Client
Prisma Client is an auto-generated, type-safe query builder generated based on the models and attributes of your Prisma schema.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It turned out that my previous suggestion to modify tsconfig.json didn’t work. However, the suggestion on this other issue to add the following to schema.prisma did help:
Also, in my case, I had to change my import to (note, your relative path may vary):
Now I can build and run without errors.
None of the provided solutions worked for me