docs(docs): explain build-time and runtime variables on Compute for Next.js #8934
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.46) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 466 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.368
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #8934"
general
weight: 0.35
ankur-arch
next buildfails in CI on Prisma Compute when a module needs a secret at import time or a prerendered page needs the database. This PR documents why, and the code changes that fix it.Linear: DR-9702. Related product work: PRS-219 (explicit build and runtime availability of environment values). From Aman Kumar Bind's Sellary evaluation, where missing staging secrets stopped his build.
The cause is a docs gap, not a Compute bug
Project variables exist only in the running deployment. The build runs in the GitHub Actions workflow, or on the developer's machine before
prisma deploy, and sees only that environment. Nothing in the docs said so.What changes
/guides/compute/nextjs-build-time-secrets. It has a table of which values exist at build time and at runtime, then three changes in the order the build fails: skip environment validation during the build, create SDK clients on first use, and decide what a prerendered page does without a database./compute/environment-variables, which states the split for every framework and links to the guide.Validation
SKIP_ENV_VALIDATIONon the action step. On the deployed service the checkout route reads its secret from the project variable, the health route queries the database, and the page that was prerendered with an empty list shows database rows after its revalidation window..envfile, which is why the table says a.envvalue reaches the running app.lint:links,lint:spellcheckandlint:versionspass.lint:codereports only the missing-title notices that sibling pages have.create-next-appnow enablescacheComponents, which rejects thedynamicandrevalidateoptions the examples use.For review
PaymentClientin step 2 is a placeholder for any SDK whose constructor checks its key. I can swap in a real SDK if you prefer a concrete example.cacheComponentsoff. The page says so, and does not cover the Cache Components way of doing the same thing.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Documentation
Clarified when project variables are available during builds and at runtime, including where to configure values required at build time.
Added a guide for building Next.js apps for Prisma Compute without runtime secrets, covering environment validation, SDK initialization, database access, rendering options, and build verification.
Added the guide to the Build on Compute listings and updated the Prisma Compute guides overview to describe building, deploying, and debugging apps.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->