prisma / nuxt-prisma

Prisma ORM integration for Nuxt
https://www.prisma.io/docs/orm/more/help-and-troubleshooting/help-articles/prisma-nuxt-module
67 stars 13 forks source link

Problems with generating prisma client using bun #47

Open Elijjahh opened 1 week ago

Elijjahh commented 1 week ago

The problem

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

What I've noticed

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
Jarred-Sumner commented 1 week ago

I think this is a bug in Bun

Elijjahh commented 1 week ago

I think this is a bug in Bun

Okay, then I'll create an issue at it's repo. Thanks)

naruko-hstk commented 1 week ago

Don't use Bun. Use Yarn instead.

abunaum commented 1 week ago

same problem, stuck in "generating prisma client" when run "bunx nuxi@latest module add prisma"

ankur-arch commented 1 week ago

Thanks for reporting the issue @Elijjahh.

same problem, stuck in "generating prisma client" when run "bunx nuxi@latest module add prisma"

Can you enable debug logging and give me the output?

BlueBazze commented 4 days ago

image Ran into the same problem with a fresh project using bun. It logs nothing after 10 mins, escaping the process dont give anything either. Manually running bunx prisma generate seems to work just fine. image

Elijjahh commented 3 days ago

Can you enable debug logging and give me the output?

@ankur-arch here is the output:

изображение

P.S: When there will be an update for npm package? I see you merged some fixes at main branch but there is no release yet

ankur-arch commented 2 days ago

P.S: When there will be an update for npm package? I see you merged some fixes at main branch but there is no release yet

Yep, I'll be releasing the fixes soon!