Module '"@prisma/client"' has no exported member 'Prisma' on Docker image build
See original GitHub issueBug 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.
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:
- Created 2 years ago
- Reactions:12
- Comments:25 (6 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
Just managed to make it work using
docker-buildx
:Should it be possible to build using Docker Desktop without buildx on a M1 Mac?
Hey y’all,
I had the same issue a few days ago, and I’ve fixed it by simply using
npx prisma generate
beforeyarn build
and afternpm install
.I hope this can help you 😉