As described in the Prisma documentation, I’m creating a Prisma client for edge functions as follows:
import { PrismaClient } from '@prisma/client/edge'
import { withAccelerate } from '@prisma/extension-accelerate'
const prisma = new PrismaClient().$extends(withAccelerate())
Then, when building for deployment, I get this error:
Error message
1:04:46 PM: There was an error when loading the '.prisma/client/edge' npm module. Support for npm modules in edge functions is an experimental feature. Refer to https://ntl.fyi/edge-functions-npm for more information.
This is my build command:
"build": "prisma generate --no-engine && remix vite:build",
How can I fix it? I couldn’t find any documentation about fixing unsupported modules in edge functions. I’m using Remix.