blitz-js / blitz-js/blitz

Running any 'blitz prisma' command throws error

Open
#4,438 3 comments 3 reactions 0 assignees View on GitHub
kind/bug status/triage
Dominant language
TypeScript
Stars
14.1k
Forks
803
PR merge metrics
No merged PRs in 30d

Description

### What is the problem?

Running any prisma command throug blitz throws an error.
E.g., `blitz prisma studio`, `blitz prisma generate`, etc.

### Paste all your error logs here:

```
➜ Project git:(main) blitz prisma studio
Loaded env from .env.local
Loaded env from .env
Error: Cannot find module '/.../node_modules/prisma/build/types.js'
```

However, running `node_modules/.bin/prisma` directly works. Running through `bun prisma` and `npx prisma` works.

### Paste all relevant code snippets here:

```
n/a
```

### What are detailed steps to reproduce this?

1. Install latest blitz version and prisma version
2. Run any command

### Run `blitz -v` and paste the output here:

```
Blitz version: 2.0.0-beta.34 (global)
Blitz version: 2.2.2 (local)
macOS | darwin-x64 | Node: v18.18.2

Package manager: npm

System:
OS: macOS 15.4.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 4.61 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.18.2 - ~/.nvm/versions/node/v18.18.2/bin/node
Yarn: Not Found
npm: 9.8.1 - ~/.nvm/versions/node/v18.18.2/bin/npm
npmPackages:
@blitzjs/auth: 2.2.2 => 2.2.2
@blitzjs/next: 2.2.2 => 2.2.2
@blitzjs/rpc: 2.2.2 => 2.2.2
@prisma/client: ^6.7.0 => 6.7.0
blitz: 2.2.2 => 2.2.2
next: 15.3.2 => 15.3.2
prisma: ^6.7.0 => 6.7.0
react: 19.1.0 => 19.1.0
react-dom: 19.1.0 => 19.1.0
typescript: ^5.8.3 => 5.8.3
```

### Please include below any other applicable logs and screenshots that show your problem:

Error: Cannot find module '/.../node_modules/prisma/build/types.js'

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `blitz prisma studio` and `blitz prisma generate` with the reported Blitz, Prisma, Node, and npm versions. Trace the `blitz prisma` command entry point and compare its module resolution with direct `node_modules/.bin/prisma`, `bun prisma`, and `npx prisma`. Done means the Blitz-wrapped Prisma commands run without the missing `prisma/build/types.js` error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.