From a03f30e6daa632990c6bab6cfd84e5608f39795e Mon Sep 17 00:00:00 2001 From: Liam O'Callaghan Date: Sun, 23 Aug 2026 15:18:15 +0200 Subject: [PATCH] docs: restore nodejs_compat flag on Cloudflare deployment page --- .../deployment/edge/deploy-to-cloudflare.mdx | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/apps/docs/content/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare.mdx b/apps/docs/content/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare.mdx index d70d53abb3..b5962db5d5 100644 --- a/apps/docs/content/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare.mdx +++ b/apps/docs/content/docs/orm/prisma-client/deployment/edge/deploy-to-cloudflare.mdx @@ -185,7 +185,7 @@ model User { If you are using a traditional PostgreSQL database that's accessed via TCP and the `pg` driver, you need to: - use the `@prisma/adapter-pg` database adapter (learn more [here](/orm/core-concepts/supported-databases/postgresql#using-driver-adapters)) -- set `node_compat = true` in `wrangler.toml` (see the [Cloudflare docs](https://developers.cloudflare.com/workers/runtime-apis/nodejs/)) +- set `nodejs_compat` in `wrangler.jsonc` (see the [Cloudflare docs](https://developers.cloudflare.com/workers/runtime-apis/nodejs/)) #### 1. Configure Prisma schema & database connection @@ -255,20 +255,19 @@ Next, install the required packages: npm install @prisma/adapter-pg ``` -#### 3. Set `node_compat = true` in `wrangler.toml` +#### 3. Set `nodejs_compat` in `wrangler.jsonc` -In your `wrangler.toml` file, add the following line: +In your `wrangler.jsonc` file, add the following lines: -```toml title="wrangler.toml" -node_compat = true +```json title="wrangler.jsonc" +{ + "compatibility_flags": [ + "nodejs_compat" + ], + "compatibility_date": "2026-08-23" +} ``` -:::note - -For Cloudflare Pages, using `node_compat` is not officially supported. If you want to use `pg` in Cloudflare Pages, you can find a workaround [here](https://github.com/cloudflare/workers-sdk/pull/2541#issuecomment-1954209855). - -::: - #### 4. Migrate your database schema (if applicable) If you ran `npx prisma init` above, you need to migrate your database schema to create the `User` table that's defined in your Prisma schema (if you already have all the tables you need in your database, you can skip this step):