I’ve got an issue which I can’t wrap my head aroun...
# orm-help
m
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
dev
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
$lib/prisma.ts
like this:
Copy code
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
adapter_vercel
to deploy to
vercel
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
$lib/prisma.ts
and re-exporting them from there removes the need for importing any part of
@prisma/client
in client-side code, and migitates the issue.
👍 1
101 Views