prisma generate takes ~25 minutes on Windows for a large schema, while the same project generates much faster on macOS
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- performance
Research direction
No reproduction is provided (schema is proprietary), so start by generating a synthetic schema of comparable size (~335 models, ~238 enums) and profiling prisma generate to find which phase dominates: schema parsing, DMMF/DSL generation, or writing client files into node_modules. Then compare Windows vs macOS file-system and path-handling code paths in the generate pipeline. Done means a identified bottleneck with a fix (or documented workaround) that brings Windows generation time in line with macOS.
Written by the indexing model from the issue text.
Description
Package and version
[email protected] @prisma/[email protected]
What happened?
prisma generate takes approximately 25 minutes to generate Prisma Client on Windows for our production-sized Prisma schema.
The exact same project/schema generates Prisma Client significantly faster on macOS.
On Windows, the command completes successfully, but generation itself takes:
✔ Generated Prisma Client (v6.17.0) to .\node_modules\@prisma\client in 1510.63s
1510.63 seconds = approximately 25 minutes 11 seconds.
There is no error, warning, or timeout. Prisma simply spends ~25 minutes generating the client.
The delay occurs specifically during Prisma Client generation. prisma migrate dev successfully applies migrations and then spends the remaining time in the generate step.
The schema is large:
- ~12,500 lines
- ~335 models
- ~238 enums
- One generator:
generator client { provider = "prisma-client-js" }
The issue is reproducible on the Windows machine and occurs consistently.
What did you expect to happen?
I expected prisma generate to complete within a reasonable amount of time for a large schema.
The same project and schema generate substantially faster on macOS, so I would expect the Windows generation time to be in the same general range rather than taking ~25 minutes.
The command does eventually succeed; the problem is the extremely long generation time.
Minimal reproduction
The production schema is proprietary and cannot be published publicly.
The schema contains approximately:
- 335 models
- 238 enums
- ~12,500 lines
The issue is reproducible with our schema using:
npx prisma generate
### Environment
```markdown
- Prisma CLI: 6.17.0
- @prisma/client: 6.17.0
- Node.js: v24.18.0
- OS: Windows 11 Pro 25H2
- OS build: 26200.9550
- Architecture: x64
- CPU: Intel Core i5-12400
- RAM: 16 GB DDR4 3200 MT/s
- Package manager: npm
- Database: PostgreSQL
- Prisma binary target: windows
- Prisma generator: `prisma-client-js`
### Additional context
### Timing
On Windows:
```text
npx prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
✔ Generated Prisma Client (v6.17.0) to .\node_modules\@prisma\client in 1510.63s
- Dominant language
- TypeScript
- Stars
- 47.8k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 227
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from prisma/orm
-
bug/1-unconfirmed kind/bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
get-platform: distros with ID_LIKE=alpine are not detected as musl, so glibc engines are used on Alpine-based imagesPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
prisma/orm#31281 · 1 comment ·
Maintainers usually reply within 1 day
-
adapter-pg: connectToShadowDb connects to the main database when built from a connection stringMay be free again @cestercian claimed this 10 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
prisma/orm#31196 · 1 comment ·
Maintainers usually reply within 1 day
-
[Prisma 8] Type-check time grows exponentially with chained .include() callsPossibly taken @SiKreuz claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
prisma/orm#31161 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
prisma/orm#31125 · 4 comments · 6 reactions ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
tenstorrent/ttnn-visualizer#2526 ·
Maintainers usually reply within 1 day
-
trySessionCache calls /get-session twice when minting session_data (cache miss or expired cookie)Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
neondatabase/neon-js#301 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tashfeenahmed/freellmapi#2305 ·
Maintainers usually reply within 1 day