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 'Prisma' on Docker image build

See original GitHub issue

Bug description

When compiling from Typescript down to JS, I get the following error: error TS2305: Module '"@prisma/client"' has no exported member 'Prisma'.

This only happens when building a Docker image. When building locally on my host I have no issues.

Older versions of the Docker engine are not giving issues.

Screen Shot 2022-03-17 at 9 58 53 AM

Screen Shot 2022-03-17 at 5 40 51 PM

How to reproduce

Dockerize your app on Docker engine 20.10.13. After installing dependencies and trying to build the project, TS should complain about the above error.

Expected behavior

The app should compile from TS to JS successfully.

Prisma information

Environment & setup

  • OS: Mac OS (M1)
  • Docke engine version: 20.10.13
  • Node base image: node:14.17.5-alpine
  • TypeScript version: 4.3.5

Prisma Version

prisma: 2.29.1 and 3.11.0 @prisma/client: 2.29.1 and 3.11.0

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:12
  • Comments:25 (6 by maintainers)

github_iconTop GitHub Comments

11reactions
fcourycommented, Mar 22, 2022

Just managed to make it work using docker-buildx:

docker buildx build --platform linux/amd64 -t partnerx .  

Should it be possible to build using Docker Desktop without buildx on a M1 Mac?

4reactions
rafaell-lycancommented, Aug 1, 2022

Hey y’all,

I had the same issue a few days ago, and I’ve fixed it by simply using npx prisma generate before yarn build and after npm install .

I hope this can help you 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
[Prisma]Module '"@prisma/client"' has no exported memberの ...
Module '"@prisma/client"' has no exported member 'Prisma' on Docker image build · Issue #12417 · pri. Bug description When compiling from ...
Read more >
Generating the client (Concepts) - Prisma
prisma/client folder, which is the default location for the unique Prisma Client generated from your schema. @prisma/client/index.d.ts exports .prisma/client :.
Read more >
Ultimate Guide: How to use Prisma with NestJS - Tom Ray
Learn how to build a backend API (REST + GraphQL) with NestJS, Prisma ... we need to create a module that exports the...
Read more >
Module has no exported member error in TypeScript
The error "Module has no exported member" occurs when we try to import a member that doesn't exist in the specified module. To...
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