question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module '"@prisma/client"' has no exported member 'PrismaClient'.ts(2305)

See original GitHub issue

Bug 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

  1. Clone the repo: https://github.com/kasir-barati/basic-prisma-nestjs-restful-api
  2. pnpm install
  3. pnpm prisma generate
  4. open src/shared/modules/prisma/prisma.service.ts
  5. See error Screenshot

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:open
  • Created a year ago
  • Reactions:3
  • Comments:24 (6 by maintainers)

github_iconTop GitHub Comments

7reactions
scottnedcommented, Jun 10, 2022

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:

generator client {
  provider = "prisma-client-js"
  output = "../node_modules/.prisma/client"
}

Also, in my case, I had to change my import to (note, your relative path may vary):

import { PrismaClient } from '../../node_modules/.prisma/client'

Now I can build and run without errors.

2reactions
mihaic195commented, Sep 6, 2022

None of the provided solutions worked for me

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found