PrismaP
Prisma17mo ago
3 replies
Slim Shady

accessing prisma generated enums on browser client

in my prisma schema I have an enum called Sizes with the values of s,
m
, l, xl
i can access that enum in on the server by importing import { Sizes } from "@prisma/client";
but whenever I import the same thing in a svelte file, the Sizes become
undefined


I temporarily fixed it by copying the values of the prisma generated Sizes
but the issue is, if the enum is updated, then i need to copy over the values again
Solution
fixed this by passing the values of Sizes from server to client
Was this page helpful?