Loading...
Loading...
Read a Prisma Next structured error envelope and route to the right recovery — code, domain, severity, why, fix, meta. Use for error, exception, my emit failed, my query won't typecheck, my query crashed, my migration won't apply, MIGRATION.HASH_MISMATCH, BUDGET.ROWS_EXCEEDED, BUDGET.TIME_EXCEEDED, RUNTIME.ABORTED, PLAN.HASH_MISMATCH, CONTRACT.MARKER_MISSING, PN-RUN-3001, PN-RUN-3002, PN-RUN-3030, PN-MIG-2001, PN-CLI-4011, PN-SCHEMA-0001, drift, capability missing, planner conflict, prisma studio, EXPLAIN, query log, db.end, db.close, script won't exit, hangs, close connection, pool.end, client is closed.
npx skill4agent add prisma/prisma-next prisma-next-debugEdit your data contract. Prisma handles the rest.
code--jsonPN-CLI-*PN-MIG-*PN-RUN-*PN-SCHEMA-*MIGRATION.*CONTRACT.*LINT.*BUDGET.*PLAN.*RUNTIME.*prisma-next-runtimeprisma-next-feedbackprisma-next ...CliErrorEnvelopepackages/1-framework/1-core/errors/src/control.ts{
"ok": false,
"code": "PN-MIG-2001",
"domain": "MIG",
"severity": "error",
"summary": "Unfilled migration placeholder",
"why": "...",
"fix": "...",
"where": { "path": "...", "line": 42 },
"meta": { "slot": "..." },
"docsUrl": "https://prisma-next.dev/..."
}PN-<domain>-<NNNN>CLIMIGRUNCONSCHEMAerror | warn | infomigration statuswarnRuntimeErrorEnvelopepackages/1-framework/1-core/framework-components/src/execution/runtime-error.ts{ name: 'RuntimeError', code: 'BUDGET.TIME_EXCEEDED', category: 'BUDGET', severity: 'error', message: '...', details: { ... } }categoryPLAN | CONTRACT | LINT | BUDGET | RUNTIMEcodedetailsdetailsmetaSqlQueryErrorSqlConnectionErrorpackages/2-sql/1-core/errors/SqlQueryErrorkind: 'sql_query'sqlState'23505'constrainttablecolumndetailcausePN-*sqlStatemeta.codePN-RUN-3000errorRuntimemeta.codemigrateMigrationToolsErrorMIGRATION.HASH_MISMATCHMIGRATION.STALE_CONTRACT_BOOKENDSMIGRATION.AMBIGUOUS_TARGETmapMigrationToolsErrorcode: 'PN-RUN-3000'meta.code: 'MIGRATION.HASH_MISMATCH'meta.codecodePN-RUN-3000--json-v--json-vPN-*prisma-next-runtime| Symptom | Next move |
|---|---|
| The runtime client does not expose |
| Script hangs after queries print / process won't exit | On Postgres the façade-owned |
| The client was closed via |
codemeta.code| Code | Where it surfaces | Next move |
|---|---|---|
| Most | Run |
| | Add |
| | Re-run |
| | Pass |
| | Add the descriptors named in |
| | Inspect |
| | Re-run with the missing/invalid flags listed in |
| | Edit |
| Reading a migration package | Restore from version control or scaffold a fresh package with |
| Loading | Use |
| Building a data-transform query plan | Pass the same |
| | DB has no marker yet. Run |
| | Marker disagrees with contract hash. Either migrate forward ( |
| Runtime startup | Contract target ≠ config target; align them (see |
| | Inspect |
| | Same as 3004. |
| | Inspect |
| | Re-run with |
| | Read |
| | Live schema does not satisfy contract. |
| | Informational; exit 0. No action needed unless |
| | Read |
| Runtime, when the | Tune |
| Runtime, when the | Fix the query (add a |
| Runtime, executing a precompiled plan | The contract the plan was built against does not match the runtime contract. Re-emit, rebuild, redeploy. |
| Runtime, marker check before executing | Same family as |
| Runtime, when an | Cancellation, not a bug; surface to the caller. |
| Raw-SQL paths surfacing a driver error | Inspect |
TypeScript error mentioning a capability (e.g. | Authoring-time, before any envelope fires | Capability gates are declared in the contract ( |
TypeScript error mentioning a missing field/method on | Authoring-time | Re-emit ( |
codefixfixprisma-next-feedbacksummarycodeseveritywhyfixmetadetailswherecodesummaryseveritymigration statusmeta.codePN-RUN-3000meta.codedb signdb signdb verifydb signmigratedb schema --db <url>migration status --db <url> --jsonprisma-next db schemapsqlDATABASE_URLprisma-next-feedbackprisma-next-runtimeprisma-next-feedbackEXPLAIN.explain()db.sql.raw\; see ). If you need first-class EXPLAIN, file a feature request via prisma-next-queriesprisma-next-feedback-v--jsonfixmetasummaryprisma-next-feedbackCliErrorEnvelopeRuntimeErrorEnvelopeSqlQueryErrorcodeseveritywhyfixmetadetailswherecodePN-RUN-3000meta.codecodedb verifymigration status --jsoncontract emitmigrateprisma-next-feedback