Prisma enums in React Native app (create-t3-turbo)
Hi guys,
I'm using
create-t3-turbo
monorepo with NextJS and React Native apps & Prisma. I do have a problem with the generated types tho, as Prisma needs node to run afaik.
I have a file in @acme/db
package called types.ts
that exports my enums:
In NextJS app it works fine, but in React Native I'm getting this error:
Error: Unable to resolve module .prisma/client/index-browser from <MY-USER-PATH>/app/node_modules/@prisma/client/index-browser.js
Is there any way that I can use Prisma generated enums in my React Native app, or should I rewrite them?
Thanks!4 Replies
I should add that I need to use enum's values - not types (
export type { ... } from ...
would not be a problem)I found the only solution to be to reimplement all the prisma enums...
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I'm still using this method in the same project haha, would love to see some other solutions as well!