Skip to content

Prisma Postgres guide: pin to Prisma ORM 7 and fix broken v7 setup steps - #14664

Merged
ArmandPhilippot merged 2 commits into
withastro:mainfrom
piyush97:docs/prisma-postgres-v7-interim
Oct 5, 2026
Merged

ArmandPhilippot merged 2 commits into
withastro:mainfrom
piyush97:docs/prisma-postgres-v7-interim

Conversation

@piyush97

@piyush97 piyush97 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Description (required)

Interim fix. This pins the Prisma Postgres guide to Prisma ORM 7 so readers can follow it again. It does not migrate the guide to Prisma ORM 8, which #14605 prefers, because I could not get a clean Prisma 8 setup working today (details below). Happy to follow up with a v8 rewrite once that works.

Since npm install prisma now resolves to 8.0.0-rc.19 (the latest tag), the guide fails at step 2. While checking it against Prisma 7, I found it was also broken there:

Step Problem Fix
Install Unpinned → installs Prisma 8 RC Pin prisma@7, @prisma/client@7, @prisma/adapter-pg@7
Install prisma init (v7) writes prisma7.config.ts, which does import "dotenv/config"; without dotenv every later command fails with Cannot find module 'dotenv/config' Add dotenv to dev dependencies
Init output Config file not mentioned List prisma7.config.ts
Schema url = env("DATABASE_URL") fails on 7.10 with P1012: "The datasource property url is no longer supported in schema files" Remove the line (the URL is read from prisma7.config.ts); update the ins highlight range
Migration Text says migrate dev also generates the client; it no longer does in v7 Reword
Links Schema reference redirects to the v8 docs Point it to the v7 schema overview

Testing (Prisma 7.10.0, Astro 7.3.5, @astrojs/node standalone, Node 22, PostgreSQL 17):

In a new create astro minimal project, I ran every command from the edited guide and copied the schema, src/lib/prisma.ts, and src/pages/posts.astro blocks from the edited file without changes.

  • npx prisma generate → ✔ Generated Prisma Client (7.10.0) to ./prisma/generated
  • npx prisma migrate dev --name init → migration created and applied
  • astro build → complete; GET /posts on the built server rendered the published post and excluded an unpublished one.
  • Control test: restoring the original url = env("DATABASE_URL") line reproduces the P1012 error.

One step was not tested end to end: prisma init --db provisions a hosted database and requires a Prisma account, so I used a local PostgreSQL instance and prisma init --output ./generated. I confirmed that --db exists in 7.10.0 (prisma init --help).

Why not Prisma 8 yet: with prisma@latest (8.0.0-rc.19), prisma orm init --target postgres --authoring psl installs @prisma/orm-postgres@8.0.0-rc.14 (its latest tag), with unresolved peer dependency warnings for @prisma/cli-engine. After that, prisma contract emit fails with CONTRACT.PACK_CONTRIBUTION_INVALID ("Malformed authoring pslBlock contribution"). I got the same result with prisma@next and with matching versions. Because of that, I could not write v8 instructions I had verified. Prisma lists v8 as a release candidate until its final release, planned for October, so a v8 rewrite seems better after that.

References

@astrobot-houston

Copy link
Copy Markdown
Contributor

Hello! Thank you for opening your first PR to Astro’s Docs! 🎉

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any broken links you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. Once a maintainer approves our workflows, you’ll be able to see a preview of your changes on Cloudflare 🥳.

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@astrobot-houston

astrobot-houston commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the tracking.ignoredKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
guides/backend/prisma-postgres.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Preview deployment

✅ Deployment complete!

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reproduced the steps using a local DB, as I don't have an account either, and this looks accurate to me! Nice catch on dotenv.

I’m going to add a link to the open issue, as I think that’s enough to close it for now. Prisma 7 is still supported, and anyone is free to update the instructions for Prisma 8 once it becomes stable. There is no need to keep an issue open for this as long as everything is working.

Thanks for your help, and welcome to Docs contributors! 🥳

@ArmandPhilippot ArmandPhilippot added 3rd-party guide Community submitted CMS, deploy, backend etc. guide improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) labels Oct 5, 2026
@ArmandPhilippot ArmandPhilippot linked an issue Oct 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3rd-party guide Community submitted CMS, deploy, backend etc. guide improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prisma Postgres guide is outdated

3 participants