bun icon indicating copy to clipboard operation
bun copied to clipboard

Latest Prisma not working with Bun - tokio crashes

Open fzn0x opened this issue 1 year ago • 2 comments

What version of Bun is running?

1.1.3

What platform is your computer?

Windows

What steps can reproduce the bug?

https://github.com/prisma/prisma/issues/23836

What is the expected behavior?

SQLite - Prisma is working fine.

What do you see instead?

thread 'tokio-runtime-worker' panicked at query-engine\query-engine-node-api\src\engine.rs:244:49: called Result::unwrap() on an Err value: JoinError::Cancelled(Id(22)) note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Additional information

Kindly check the issue link I provide.

fzn0x avatar Apr 12 '24 07:04 fzn0x

Just curious. Do you have node installed on your system? I recently noticed an issue where prisma does not work if node is not installed.

touhidurrr avatar May 07 '24 01:05 touhidurrr

Just curious. Do you have node installed on your system? I recently noticed an issue where prisma does not work if node is not installed.

Yes, I have node installed on my machine

fzn0x avatar May 07 '24 02:05 fzn0x

Observing the same bug on both Windows and Linux with [email protected]. I have Node.js installed on both machines.

I managed to create the following minimal example:

  1. Follow https://bun.sh/guides/ecosystem/prisma
  2. Run the following code
import { Prisma, PrismaClient } from '@prisma/client';

const prismaClient = new PrismaClient();

(async () => {
  const result = await prismaClient.$queryRaw(Prisma.sql`SELECT 1+1`);
  console.log("success");
  console.log(result);
})();

This either throws the abovementioned tokio error or it does nothing (nothing is printed).

What is interesting that the following code works perfectly:

import { Prisma, PrismaClient } from '@prisma/client';

const prismaClient = new PrismaClient();

//(async () => {
  const result = await prismaClient.$queryRaw(Prisma.sql`SELECT 1+1`);
  console.log("success");
  console.log(result);
//})();

sstenchlak avatar Jun 13 '24 12:06 sstenchlak