Prisma is throwing __filename is not defined specifically in SST cron jobs
This is a weird issue, when I'm running prisma through SST's cron job, which I need in order to do database processing tasks, I get an error that says
__filename is not definedand the cron job fails. I've tried a workaround with but unfortunately this doesn't seem to disconnect the prisma client ever or something, and so I get errors down the line because there are too many prisma clients connected.
5 Replies
Sorry, correction, it's saying "Can't find module '@prisma/client'"
Hi @AirmanEpic 👋
Can you switch your Prisma Client import code to the code below?
this throws an error saying __filename not found
that's why it was switched to the weird looking import
also, o/ and thanks for the help
Can you share more information about the error it throws? At what point does this error surface
Error shows up on cron jobs using SST. Normally it works fine in SST but for some reason this specific situation breaks it. I'll sample the full error for you next time I can but it basically boils down to __filename not defined.
I found a workaround somewhere that uses that alternative thing but that doesnt seem to work either
@RaphaelEtim thanks for the help again
Anyone know what's going on here?