prisma generate takes ~25 minutes on Windows for a large schema, while the same project generates much faster on macOS

Open
#30,625 0 comments 0 reactions 0 assignees View on GitHub

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

bug/1-unconfirmed kind/bug
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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from prisma/orm

All issues in prisma/orm

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.