03/17/2022, 1:25 PM
I’ve got an issue which I can’t wrap my head around. I’m using Prisma with SvelteKit (vite & typescript). All works fine in
but, running deploy returns this error in the browser:
Uncaught TypeError: Failed to resolve module specifier ".prisma/client/index-browser". Relative references must start with either "/", "./", or "../".
I am instantiating Prisma in
like this:
import Prisma, * as PrismaAll from '@prisma/client'
const pc = Prisma?.PrismaClient || PrismaAll?.PrismaClient
export const prisma = new pc()
and importing it in there from my endpoints. I’m using
to deploy to
Any idea what might be the issue here?
I am unsure wether I’ve found the issue, but I have found a solution. Importing all types in
and re-exporting them from there removes the need for importing any part of
in client-side code, and migitates the issue.
👍 1