oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.35k stars 2.78k forks source link

Prisma crashing when logging is enabled #15291

Open ilijapuaca opened 1 day ago

ilijapuaca commented 1 day ago

What version of Bun is running?

1.1.36

What platform is your computer?

Darwin 24.1.0 arm64 arm

What steps can reproduce the bug?

In our application, enabling logging when instantiating Prisma client like so causes a crash on application startup

const prisma = new PrismaClient({datasourceUrl: config.url, log: ['info']});

I have tried to create a minimum example to reproduce the issue with, but it does not happen in a fresh project. I tried stripping down any pieces that could have to do with prisma interactions without any luck

What is the expected behavior?

Application not crashing

What do you see instead?

The application crashes on startup (or when trying to log anything) with the following error and no stack trace

error: Call JavaScript callback failed in threadsafe function
 code: "FunctionExpected"

Additional information

I'd be happy to provide any additional information here, or help solve the issue, but there is very little to go by based on the error message output when the crash happens. Logging used to work fine for a while before the issue started happening, but it's hard to pinpoint the exact time it stopped and whether bun version upgrade is somehow involved.

We're running the latest version of Prisma@5.22.0