core icon indicating copy to clipboard operation
core copied to clipboard

Correct config for Prisma with Supabase on Cloudflare

Open mtzrmzia opened this issue 6 months ago • 4 comments

Describe the bug I'm trying to relocate my Vercel projects to Cloudflare through NuxtHub. I'm using Prisma ORM with Supabase and on Vercel deploy the project works as expected, but in Cloudflare not. I got 500: Cannot read properties of undefined (reading 'exec'). error but in local works!

Steps to reproduce Steps to reproduce the behavior:

  1. Install prisma and @prisma/client dependencies then add prisma generate to build command:
{
  "name": "esteba-app-appointments",
  "private": true,
  "type": "module",
  "scripts": {
    "build": "prisma generate && nuxt build",
  },
  "dependencies": {
    "@prisma/client": "^5.18.0",
    "@vueuse/core": "^11.0.1",
    "nuxt": "^3.13.0",
    "vue": "latest",
  },
  "devDependencies": {
    "prisma": "^5.18.0",
    "wrangler": "^3.72.2"
  },
  "packageManager": "[email protected]"
}
  1. Create prisma/schema.prisma file:
generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}
  1. set supabase credentials on environment variables project

and thats it, on Vercel this works

Expected behavior Request sent as expected

I'm doing my research, and this issue happens to another person Cloudflare issue

mtzrmzia avatar Aug 24 '24 03:08 mtzrmzia