Prisma with D1 NextJs and CF Workers
I am trying to use Prisma ORM with D1 in NextJs on Cloudflare Workers. This works when running
npm run dev. However, as soon as I attempt to use npm run preview or npm run deploy my website breaks and returns the following error when I try to use any server functions. I believe this has something to do with prisma since it is trying to access the file system, but I have driverAdapters enabled so prisma should work on the edge. Could this have anything to do with opennext, and if so how can I fix it?
my repo is: https://github.com/BearTyree/Flash-Royale
the error is:
1 Reply
For anyone finding this in the future:
The solution is to either not use windows, or not use prisma.
https://github.com/sommeeeer was able to get my repo working on linux after wiping the folders
rm -rf .next .open-next .wrangler node_modules and trying again.
I was able to get drizzle working on windows in dev and preview so I recommend using that instead of prisma if you are on windows.GitHub
sommeeeer - Overview
A norwegian guy with passion for web development and open source - sommeeeer