Back to Blog

Prisma Client Not Found After Deploying to Render

Published: July 28, 2026
Prisma Client Not Found After Deploying to Render

Prisma client not found in production, while everything works perfectly on your machine, comes down to one detail that's easy to forget entirely: the generated Prisma Client isn't part of your source code, and Render has no reason to regenerate something it doesn't know is missing unless your build command tells it to. Locally, you ran prisma generate at some point — maybe once, maybe automatically via an IDE plugin — and never thought about it again. Render builds fresh every time, and "fresh" means no generated client exists until something explicitly creates it.

Short answer: prisma generate has to be an explicit part of your Render build command, not something you're assuming npm install handles for you. If it's only in postinstall and Render installs with a production-only flag, or if prisma itself is sitting in devDependencies and gets skipped entirely, the generate step never runs, and the import fails the first time your code actually touches the database.

An unfinished wooden jigsaw puzzle with one piece clearly missing, representing the generated Prisma Client your build never actually produced

Why Prisma Client Not Found Happens on Render but Never Locally

The generated Prisma Client isn't hand-written code sitting in your repository — it's output produced by running prisma generate against your schema.prisma file, and that output has to exist in whatever environment is running the app. Locally, it almost always does, because you (or your editor, or a postinstall hook you forgot was there) ran it at some point during setup. On a fresh Render build, none of that history exists. If prisma generate isn't something the build explicitly runs, there's simply no generated client to import, and the app throws at the first line that tries to use it — commonly as Cannot find module pointing at wherever the generated output was configured to live, or @prisma/client did not initialize yet. Please run "prisma generate", depending on exactly how far the import gets before failing.

(If you've been adding more try/catch blocks around your database calls hoping to at least get a cleaner error — this one doesn't need better error handling. It needs the build to run one more command.)

Fix 1: Make prisma generate an Explicit Build Step

The most direct fix is putting prisma generate in the build command itself, not relying on it happening implicitly:

JSON
1// package.json
2{
3  "scripts": {
4    "build": "prisma generate && nest build",
5    "start:prod": "node dist/main.js"
6  }
7}

On Render's dashboard, confirm the Build Command field is actually running this script (npm run build, or the equivalent for your framework) rather than something that skips it — a surprising number of "Prisma Client not found" reports trace back to a build command that was never updated after Prisma was added to the project. Render's own Node deployment docs are worth a direct read for exactly what its build and start commands expect, since the defaults it suggests don't always account for a generation step your framework's starter didn't originally need.

Fix 2: Check Whether Prisma Is Actually in Dependencies

postinstall scripts running prisma generate are common and usually work — but only if the prisma CLI package is actually installed in the environment running that script:

JSON
1// package.json — prisma needs to be a real dependency if generate runs during a production install
2{
3  "dependencies": {
4    "prisma": "^7.0.0",
5    "@prisma/client": "^7.0.0"
6  },
7  "scripts": {
8    "postinstall": "prisma generate"
9  }
10}

If prisma is sitting under devDependencies and Render's install step runs in a mode that skips dev dependencies, the prisma command doesn't exist at all when postinstall tries to call it — a build failure that reads confusingly like a missing script rather than the dependency placement issue it actually is. Prisma's own client-generation documentation is worth checking directly against whichever Prisma version you're on, since exact defaults have shifted across major versions.

Water bottles moving along an automated conveyor belt in a modern factory, representing the generated client being produced fresh on every build instead of assumed to already exist

Fix 3: If You're Using a Custom Output Path, Check It Explicitly

Current Prisma versions require an explicit output path in the generator block rather than writing to an implicit default location:

PRISMA
1// prisma/schema.prisma
2generator client {
3  provider = "prisma-client"
4  output   = "../src/generated/prisma"
5}
TypeScript
1// src/prisma.service.ts
2import { PrismaClient } from './generated/prisma';
3
4export class PrismaService extends PrismaClient {}

If your build succeeds but the app still can't find the client, confirm the custom output directory is actually where your import statements are looking — a mismatch between the generator's output path and the path your code imports from produces the exact same "module not found" symptom, just for a completely different reason than a missing prisma generate call.

The Caching Trap That Looks Like a Generation Problem

One more variant worth checking before assuming prisma generate isn't running at all: if Render is caching node_modules or your custom output directory between deploys, and your schema.prisma changed since the last successful cached build, you can end up with a stale generated client — one that exists, so the "module not found" error doesn't fire, but doesn't match your current schema, so queries against new fields or models fail instead. This looks like a different bug entirely until you check the generated client's age against your last schema change. Clearing the build cache and forcing a clean install resolves it.

A close-up of a printed expiration date on a can seal, representing a cached, outdated Prisma Client being served instead of a fresh one

The Opinion Part

Here's the position worth stating plainly: treating a generated build artifact as though it were regular source code — present because you remember running a command once, rather than because your build process guarantees it — is exactly the kind of assumption that costs nothing until it costs a failed deploy at the worst possible time. Standish's data on project outcomes backs the general principle even outside this specific bug: a large share of "challenged" projects (roughly half, per Standish CHAOS) trace back to exactly this category of unglamorous process gap rather than a hard technical problem. prisma generate running reliably on every build isn't a nice-to-have step — it's the difference between "my ORM works" being a fact about your code and being a fact about your local machine's history that nobody wrote down.

Conclusion

If Prisma Client is missing after deploying to Render, it's not a broken Prisma installation and it's not a Render platform issue — it's a build step that never explicitly ran prisma generate in the new environment, or a dependency placement that quietly skipped it. Make generation an explicit build command, confirm prisma is installed where the build actually needs it, and double-check your custom output path lines up with your imports if you're using one.

If you're chasing intermittent connection errors on the same deployment once the client itself is sorted, our Prisma connection pool guide for serverless platforms covers the next layer of this stack, and if migrations are the part still giving you trouble, our shadow database permission guide covers that specific wall.

Add the one command the build was missing, redeploy, and enjoy a Prisma Client that actually exists where your code is looking for it.

Frequently Asked Questions

Because prisma generate writes the generated client code to disk based on a one-time (or occasional) local run you probably forgot happened at all. Locally, that generated output is already sitting on your machine from whenever you last ran it. Render builds from a clean checkout every time — if prisma generate isn't an explicit part of the build command, there's no generated client in the fresh environment, and the import fails.

Usually, but not always. postinstall runs after npm install, which covers most cases — but if Render's build process installs with a production-only flag that skips devDependencies, and prisma itself is listed only under devDependencies, the prisma CLI command won't exist to run at all, postinstall step or not. The safer fix is making prisma generate an explicit step in your build command, and confirming prisma is a real dependency, not just a dev one.

By default, many projects list prisma (the CLI) under devDependencies since it's only needed to generate the client, not at runtime. If Render's build step installs dependencies in a production mode that skips devDependencies, the prisma command is simply missing, and any script step calling prisma generate fails outright rather than producing a stale-client error — a different, easier-to-misdiagnose failure than the one this article opens with.

Yes. If Render caches node_modules (or a custom output directory) between deploys and your schema.prisma changed since the last successful generate, a cached but outdated generated client can get reused instead of a fresh one — meaning the deploy succeeds, but queries against new fields or models fail in ways that look like a generation problem even though generate technically ran at some point in the cache's history. Clearing the build cache and forcing a clean generate resolves it.

The underlying cause is identical either way — prisma generate needs to run during the build, full stop. The only difference is what the resulting 'module not found' error actually names: with a custom output path configured in the generator block, the missing-module error points at wherever you configured output to write to, rather than the classic default location, which can make the error look unfamiliar even though the fix is the same.

Portrait of Umar Farooq

About Umar Farooq

Umar Farooq is the founder and lead engineer of Codify SaaS. He builds B2B SaaS products and web applications on modern TypeScript stacks and enterprise Java, and writes code-first guides drawn from real production work — the schema decisions, the migrations that almost went wrong, and the performance fixes that actually moved the numbers. When he recommends an approach, he shows the code and explains the trade-offs.

Read full bio