Prisma preparation & errors
Choose the workflow for the installed Prisma major.
Generate or emit, before build
| Installed version | Portal 1.0.0 behavior |
|---|---|
| Prisma 2–7 | Read the package bin and run the local CLI with generate. |
| Prisma 8, including RCs | Read the package bin and run contract emit. |
| No Prisma indicators | Skip Prisma preparation. |
| Other/invalid version | Stop with an unsupported/invalid-version diagnostic. |
Detection uses dependencies, standard schema files, package.json schema settings or Prisma config files in the selected directory. Preparation runs after dependency installation, even with build disabled, using the project environment. The CLI reads config itself. Portal does not download a CLI or run migration, reset, seed, db init, db update or db sign.
Inspect the installed package
Run this in an installed development checkout of the selected directory. It prints only the package version and CLI entry, not environment secrets. If the package is actually missing, add prisma at a version compatible with the app runtime/client, update and commit its lockfile, then test locally. Do not add a second Prisma version just to satisfy an old hardcoded Portal path.
node -e "const p=require('./node_modules/prisma/package.json'); console.log({version:p.version, bin:p.bin})"Keep config compatible with your major
Prisma 2–7 uses a schema and client generator. For a custom path, use config supported by the installed version. Prisma 8 uses an orm contract configuration. Current Prisma 8 config uses definePrismaConfig from prisma/config with the database-specific defineConfig helper; earlier release candidates can have different imports. Do not rewrite working RC config using a newer example without checking the installed exports. A config file cannot fix a Portal CLI-path mismatch.
Keep an explicit contract:emit build script if the app needs it; automatic Prisma 8 preparation emits first. If no Prisma dependencies, schema settings, standard schemas or config files exist, no config is required.
Prisma 8 configuration · Contract emit
Handle the right failure
| Evidence | Action |
|---|---|
| Local CLI missing; prisma package absent | Add the compatible local dependency, install and commit the lockfile. |
| 0.8.7/0.8.8 says CLI missing; Prisma 8 dist/prisma.js exists | Portal compatibility issue. Portal 0.8.9 resolves it; no extra project config is needed. |
| CLI entry missing/invalid or version unsupported | Check installed metadata, dependency versions, lockfile and selected directory. |
| Client generation or contract emission failed | Read redacted deploy details; check schema/contract, version-specific config and required environment. |
| Lockfile mismatch | Reconcile package.json and the lockfile in development and commit both. |
| Candidate failed; prior release active | Verify the active service separately. Retry after fixing the source of failure. |
Do not include DATABASE_URL, tokens or full environment output in an error report. A failed preparation stops the candidate before activation; inspect the active release and its health independently.