Prisma in module worker

Anyone have an example of using '@Prisma/client/edge' in a cloudflare module worker? I am getting:
`Invalid
value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
`Invalid
value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
when justing doing a simple:
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
console.log(env.DATABASE_URL)
const prisma = new PrismaClient({
datasources: {
db: {
url: env.DATABASE_URL,
}
}
});
const users = await prisma.user.findMany();
return new Response("Hello World!");
},
};
export default {
async fetch(
request: Request,
env: Env,
ctx: ExecutionContext
): Promise<Response> {
console.log(env.DATABASE_URL)
const prisma = new PrismaClient({
datasources: {
db: {
url: env.DATABASE_URL,
}
}
});
const users = await prisma.user.findMany();
return new Response("Hello World!");
},
};
console log on the DATABASE_URL showing correct and I am able to connect to it fine with a nestjs repo
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server