Skip to content

marcomafessolli/remix-prisma-cloudflare-workers

Repository files navigation

Remix + Cloudflare Workers + Prisma!

Live Demo

Setup

Before starting, make sure you have the following:

  • node >= 16
  • A Prisma Data Proxy account
  • Followed steps #6 and #7 at Prisma and Cloudflare documentation
  • A .env file with DATABASE_URL that points to your prisma data proxy account

After that, do the following:

  • npm install
  • PRISMA_CLIENT_ENGINE_TYPE=dataproxy npx prisma generate

Check Prisma and Cloudflare for more information.

Note

Currently, theres an open issue prisma/prisma#12356 about normalizeAndValidateHeaderValue which is causing the prisma-client-js to fail. As a workarround, I've added a patch using patch-package that works while the issue isn't resolved. Make sure that patch-package runs after npm install

Credits to @clintonwoo for finding a solution / workarround.

Development

$ npm run dev

And then check http://127.0.0.1:8787. You're ready 💇‍♂️

Deployment

npm run deploy