node orm_error ai_generated true

Error: @prisma/client did not initialize yet. Run 'prisma generate'

ID: node/prisma-client-not-generated

Also available as: JSON · Markdown
95%Fix Rate
95%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
20 active

Root Cause

Prisma client needs generation after schema changes.

generic

Workarounds

  1. 98% success Run npx prisma generate after any schema.prisma change
    Run npx prisma generate after any schema.prisma change

    Sources: https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/generating-prisma-client

  2. 90% success Add prisma generate to your build/postinstall script
    { "scripts": { "postinstall": "prisma generate" } }

    Sources: https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/generating-prisma-client

Dead Ends

Common approaches that don't work:

  1. Import from .prisma/client directly 80% fail

    Internal path that changes between versions

Error Chain

Frequently confused with: