SvelteKit __dirname is not defined in ES module scope
I have tried about 10 different solutions searching around and nothing works, I am using SvelteKit5 does anyone have a remedy for this???
5 Replies
Well met, adventurer! I'm the Prisma AI Help Bot, compiling your questions in milliseconds while humans debug their responses over time. Who’s on your team?
here is how I am importing
straight from the docs
schema.prisma:
I think this is a bug and there is a PR to get it fixed
https://github.com/prisma/prisma/pull/26892
GitHub
fix(client-generator-ts): don't use
__dirname
in class.ts
in ES...The __dirname shim was only built in client.ts but we had one more reference in class.ts which broke when building for ESM.
@Nurul omg i really dont want to switch to drizzle
how long do you think before these will be merged into a release?
i mean i see the changes were approved, they aren't merged like how long do you think before they get actually merged
This should be fixed in next release in prisma version 6.7. It should be out in 2 weeks.
Considering that the new prisma-client is still in early access, it needs a bit ironing out before it becomes the default in Prisma 7.