Skip to content
Back to the playbook

Fixing PrismaClientInitializationError from a missing or bad connection string

Prismarevision 1

Diagnostic tree

  1. In progressPrismaClientInitializationError only in the deployed environmentThe client fails before any query runs, which points at initialization-time configuration rather than a query or schema problem.
View the whole map (8 more steps)
  • Confirm the env var Prisma expects is actually set in the deploy environment
  • Check whether the connection string is well-formed and matches what schema.prisma expects
  • The env var never made it into this environment
  • Connection string looks fine — likely not a configuration issue
  • Connection string is malformed or points at the wrong variable name
  • Set the correct, correctly-encoded connection string in the deploy environment
  • Confirm the client initializes
  • Resolved

What to test

PrismaClientInitializationError only in the deployed environment

The client fails before any query runs, which points at initialization-time configuration rather than a query or schema problem.

What happened?