Hi! I am trying to use Prisma for storing relational data on an app I am developing. However, upon instantiating the client connection, it fails during deployment.
Here is my code:
import Resolver from '@forge/resolver';
const resolver = new Resolver();
import { PrismaClient } from '@prisma/client';
resolver.define('getText', (req) => {
console.log(req);
return 'Hello, world!';
});
resolver.define('getResources', (req) => {
const client = new PrismaClient();
return await client.resource.findMany();
});
export const handler = resolver.getDefinitions();
This code runs fine during linting and build, but fails during the snapshot process. Here is a preview of the error.
I have been looking for any workaround but I haven’t seen this issue on the forum.
Hoping for your response. Best regards,
Ivan