Cannot import type in svelte component
Hi, I'm trying to use prisma-generated types in a Svelte (client side) component.
Is this possible in principle? I want to set the color depending on the value the prop
type
has. My browser console tells me TagType
is undefined, but I don't get why. Vite doesn't report any errors.
My IDE tells me that type === TagType.FIRE
always returns null because there is no overlap.
Can I solve this somehow?
Thanks in advance!4 Replies
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into
#ask-ai
for a quick spin!Hey ๐
Does the solution specified in this GH Discussion work for you?
https://github.com/prisma/prisma/discussions/14909
GitHub
Share Prisma types with frontend application? ยท prisma prisma ยท Dis...
Is it possible to share auto-generated TypeScript types with a front-end application?
Thanks for the quick answer! I just saw https://github.com/prisma/prisma/issues/12504 which has a solution that works for me.
GitHub
Importing
enum
in browsers results in `Error resolving module spe...Bug description I have the following error message in my browser upon using sveltekit and the command "npm run preview": Uncaught TypeError: Error resolving module specifier โ.prisma/clie...
I am glad to hear that ๐