You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/800-guides/090-nextjs.mdx
+6-23Lines changed: 6 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: 'How to use Prisma ORM and Prisma Postgres with Next.js'
3
-
metaTitle: 'How to use Prisma ORM and Prisma Postgres with Next.js 15 and Vercel'
3
+
metaTitle: 'How to use Prisma ORM and Prisma Postgres with Next.js and Vercel'
4
4
description: 'Learn how to use Prisma ORM in a Next.js app and deploy it to Vercel'
5
5
sidebar_label: 'Next.js'
6
6
image: '/img/guides/prisma-nextjs-cover.png'
@@ -22,12 +22,12 @@ community_section: true
22
22
23
23
</details>
24
24
25
-
This guide shows you how to use Prisma with Next.js 15, a fullstack React framework. You'll learn how to create a [Prisma Postgres](/postgres/) instance, set up Prisma ORM with Next.js, handle migrations, and deploy your application to Vercel.
25
+
This guide shows you how to use Prisma with Next.js, a fullstack React framework. You'll learn how to create a [Prisma Postgres](/postgres/) instance, set up Prisma ORM with Next.js, handle migrations, and deploy your application to Vercel.
26
26
27
27
You can find a [deployment-ready example on GitHub](https://github.com/prisma/prisma-examples/blob/latest/orm/nextjs).
28
28
29
29
## Prerequisites
30
-
-[Node.js 20+](https://nodejs.org)
30
+
-[Node.js](https://nodejs.org) v20.19+, v22.12+, or v24.0+
31
31
- A Vercel account (if you want to deploy your application)
32
32
33
33
## 1. Set up your project
@@ -89,10 +89,11 @@ You'll need to answer a few questions while setting up your Prisma Postgres data
89
89
This will create:
90
90
91
91
- A `prisma` directory with a `schema.prisma` file.
92
-
- A `prisma.config.ts` file for configuring Prisma
92
+
- A `prisma.config.ts` file for configuring Prisma.
93
93
- A Prisma Postgres database.
94
94
- A `.env` file containing the `DATABASE_URL` at the project root.
95
-
- An `output` directory for the generated Prisma Client as `app/generated/prisma`.
95
+
96
+
The `app/generated/prisma` output directory for the generated Prisma Client will be created when you run `prisma generate` or `prisma migrate dev` in a later step.
Before starting the development server, note that if you are using Next.js v15.2.0 or v15.2.1, do not use Turbopack as there is a known [issue](https://github.com/vercel/next.js/issues/76497). Remove Turbopack from your dev script by updating your `package.json`
253
-
```json file=package.json
254
-
"script":{
255
-
//delete-start
256
-
"dev": "next dev --turbopack",
257
-
//delete-end
258
-
//add-start
259
-
"dev": "next dev",
260
-
//add-end
261
-
}
262
-
```
263
-
This change is not needed on any versions before or after.
264
-
265
-
:::
266
-
267
250
Finally, run `prisma db seed` to seed your database with the initial data we defined in the `seed.ts` file.
0 commit comments