oven-sh / bun

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

Problems with generating prisma client using bun #14962

Open Elijjahh opened 2 weeks ago

Elijjahh commented 2 weeks ago

What version of Bun is running?

1.1.33

What platform is your computer?

Macos 15.1

What is the expected behavior?

I should get generated client.

What do you see instead?

When I install @prisma/nuxt and start at dev mode everything works until "Generating Prisma client...". At this moment it just freezes and nothing happens

Steps to reproduce:

# creating nuxt project
bunx nuxi@latest init <my-app>

bun install @prisma/nuxt

Add "@prisma/nuxt" to nuxt modules and run:

bun run dev

Additional information

There are some experiments that I've done. I've noticed that it works when there is no bun.lockb. So I tried installing packages and start dev mode with deleted bun.lockb and it worked.

Also if I add bunfig.toml:

[install.lockfile]

# whether to save the lockfile to disk
save = false

then it also works.

Also after successful first time (using no bun.lockdb or bunfig.toml) it works anyway (with/without bun.lockdb). I am new to bun and prisma so I don't know the exact reason. I guess that "@prisma/nuxt" installs "@prisma/client" at first time and that breaks everything and at second time it is already installed so everything works. And it's very strange that bun.lockdb somehow affects runtime

Screenshots

Generation freezes. You can see that it started at 22:03 and I made a screenshot at 22:06:

изображение

Generation works good. Removed @prisma/nuxt from modules so it doesn't run at nuxt prepare. Then removed bun.lockdb and ran bun dev:

Снимок экрана 2024-11-01 в 22 12 12 Снимок экрана 2024-11-01 в 22 13 33

Generation works. Added bunfig.toml

Снимок экрана 2024-11-01 в 22 17 11
realspinelle commented 5 days ago

in case your searching for a fix downgrade ur bun to 1.1.29