← Back to Pull requests

docs(guides): fix the Vike and Remix guides, which fail on Composer 0.41.2 #9031

Open
unknown opened this pull request with 640 lines diff across 8 files
View on GitHub
unknown unknown commented on Dec 03, 2026 12:43 UTC
Author

The Vike and Remix guides install the latest Composer, now 0.41.2, and both fail on it: Composer 0.41 requires every database to set targetRef, the ref a deploy migrates the database to, and neither guide sets it, so the type check fails. This pull request adds targetRef to both guides, with the committed ref it needs, and creates the first migration with migration plan and db migrate in place of db init. Both guides were run end to end on Composer 0.41.2, Prisma ORM 8.0.0-rc.28 and prisma 8.0.0-rc.39, including a deploy to Prisma Compute and a schema change.

At a glance

Each guide's module.ts now names the ref its database migrates to:

targetRef: resolve([environment.name], ([name]) => (name === "production" ? "production" : "@contract")),

A ref is a file in migrations/app/refs/ that names the migration a database should be at. Production migrates to a committed production ref, which the reader moves forward with prisma migration ref set production <migration directory> after each schema change. Every other environment, including prisma dev and the preview that deploy on push creates for each Git branch, migrates to @contract, the contract the commit emits, so a preview needs no ref of its own. The Composer page on deploying compares this rule with giving every environment its own ref (section "A ref for each new environment"), and both guides link to it.

What changes

Both guides:

  • module.ts passes targetRef. The guide commits a production ref before the first deploy and moves it after a schema change. Vike's troubleshooting adds the error a deploy gives for a missing ref, MIGRATION.UNKNOWN_REF.

  • The first migration is planned in step 3, from the empty database, and applied with prisma db migrate. The production ref has to point at a migration that exists before the first deploy, and planning it first means every database, local or deployed, gets its tables from the same committed migration. Before, both guides created the local tables with db init and planned a baseline migration from that database later. The sample output shows the plan's notice about db init and says why it can be ignored.

  • The contract entry lists PostgreSQL 17's capabilities in place of the PostgreSQL 18 list orm init writes. Prisma Postgres runs PostgreSQL 17, and the ORM's rule is to list the oldest version the contract runs on. In ORM 8.0.0-rc.28 the two lists are identical, so this changes no behaviour today.

  • The agent prompts follow the same steps as the text; Vike's prompt now also runs the built app under prisma dev.
  • Vike:

  • Its prerequisites ask for Bun 1.3.14 or newer, for step 6, where prisma dev runs the built server with Bun. In the test run, Bun 1.3.13 returned an error on every page and Bun 1.4.5 worked; 1.3.14 is the first release after the failing one and was not run itself. This is not caused by Composer 0.41.2; the run found it, and the guide had no Bun version before. A troubleshooting entry says how to upgrade.
  • Remix:

  • The prerequisites ask for an empty database, because step 3 plans the first migration from an empty one. Vike says the same for a database of your own.

  • The migrations prisma migration plan writes import their contract snapshot without a file extension, which the starter's "moduleResolution": "NodeNext" rejects. The ORM writes them that way on purpose. The app never imports them, so step 3 adds migrations to exclude in tsconfig.json. Without it, the guide's own type check fails once the first migration exists.

  • Composer's local state folders, .alchemy/ and .prisma-composer/, are added to .gitignore, as the Vike guide already did.
  • How it was checked

  • Vike: a new app through prisma dev, a deploy, a schema change and a second deploy.

  • Remix: a new app through its type check, seed, dev server, a deploy, a schema change and a second deploy.

  • Two separate reviewers checked the commands against the CLI and Composer; their findings are fixed here.
  • Left out

  • The full-stack tutorial, (index)/full-stack-tutorial.mdx, follows the app npm create prisma scaffolds, which still installs Composer 0.40.0, so it is consistent today. Its rewrite waits for the create-prisma release that makes the scaffold install Composer 0.41.2.
  • Agent: herodotus-23

    🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Documentation
    Updated the Remix and Vike guides with PostgreSQL setup instructions for empty databases and workflows for planning, applying, and committing migrations.
    Clarified PostgreSQL capability compatibility, Vike’s Bun version requirement, and how to configure migration references across environments.
    Revised deployment and schema-change steps, troubleshooting guidance, and agent prompts; added instructions for excluding migrations from TypeScript checks and ignoring Composer state.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 640 lines (+480 / -160) across 8 files Reviewer: wmadden-electric Review duration: 194m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 640 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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.387
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #9031"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 51.9% (MEDIUM) · Higher = larger blast radius
    51.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.7% · Safe to merge
    27.7%
    Repository