bun
bun copied to clipboard
bunx prisma generate hangs indefinitely on v1.1.30 but works fine on v1.1.29
What version of Bun is running?
1.1.30+7996d06b8
What platform is your computer?
Linux 6.8.0-1013-oracle aarch64 aarch64
What steps can reproduce the bug?
1- Install Bun v1.1.30. 2- Run bunx prisma generate.
What is the expected behavior?
bunx prisma generate should successfully generate Prisma files and exit without hanging.
What do you see instead?
On Bun v1.1.30, the process hangs indefinitely and never completes.
Additional information
This issue only occurs on v1.1.30. The exact same command works fine on v1.1.29.
I can reproduce this issue as well, but when I upgraded to the canary version, it seemed to work again. Does upgrading with:
bun upgrade --canary
resolve the issue for you too?
Unfortunately, the same problem persists for me in canary.
Haven't been able to reproduce this locally, however I think this has been wrecking my my docker build causing the prisma generate step to silently fail. Had to use imbios/bun-node as the base instead of oven/bun
I'm also having the same issue. I'm using Windows and bun hangs with versions 1.1.30, 1.1.31, 1.1.32 and the latest canary build, everything works fine with version 1.1.29.
the same :'( on macos
I have not fixed it and not sure this is the same but on MacOS: it just stopped working as well after I upgraded bun. Trying to downgrade to test...
The way I work now is as follows. First I downgrade to version 1.1.29, then I migrate and generate client. In order to start the seeding process, I have to upgrade to the latest version again, because v1.1.29 seeding process ends the process directly without waiting for the seeding process to finish. As you can understand, there is a very problematic workflow.
@nektro will start working on fixing this soon
Hello, today I read that some bugs related to prisma were solved in v1.1.37 version, but the prisma generate command is still stuck. I just wanted to remind you of this problem.
FWIW https://github.com/prisma/prisma/issues/25730
I can confirm that canary does not fix anything, and that the infinite silent hang in my docker builds was solved by pinning the base image to oven/bun:1.1.29
Working today with prisma@latest (6.0.1)
PR #15629 should fix this.
is this fixed?
I am using bun version 1.1.39, but still stuck when runs bunx prisma generate
that pr is available if you use bun upgrade --canary but has not made it into a release yet
When I try it with Bun Canary, the situation looks the same.
- bun upgrade --canary
- bun prisma generate
Message: "Environment variables loaded from .env Prisma schema loaded from src"
after that it's stuck.
@Eldar-X canary builds weren't running last week unfortunately, can you give it another try?
Our next step before closing this is to add an integration test that runs prisma generate with --bun
I upgraded to canary version again but unfortunately there is no change.
$ prisma gen
============================================================
Bun Canary v1.1.41-canary.29 (b8f28ed8) Linux x64
WSL Kernel v5.15.167 | glibc v2.36
CPU: sse42 popcnt avx avx2 avx512
Args: "node" "/home/i/_/nito-projects/node_modules/.bin/prisma" "gen"
Features: dotenv jsc transpiler_cache(4) tsconfig(2) tsconfig_paths
Builtins: "bun:main" "node:fs" "node:string_decoder" "node:util/types"
Elapsed: 76ms | User: 59ms | Sys: 19ms
RSS: 1.07GB | Peak: 60.45MB | Commit: 1.07GB | Faults: 0
panic(main thread): Segmentation fault at address 0x0
Crashed while visiting /home/i/_/nito-projects/node_modules/@prisma/get-platform/dist/chunk-6HZWON4S.js
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.1.41/ln2b8f28edChw/7//BoqkumE+kgP06rjoDqt4miDqz20hD+s45gDy364gDkhn6gD40vs+D_A2AA
Still hangs, with latest canary build..
There doesn't seem to be any progress on this issue for a long time. I hope it doesn't get lost among other issues.
I was also hitting this, as a workaround, I installed node on my image as suggested here on Discord: https://discord.com/channels/876711213126520882/876711213126520885/1305786915445932124, then running prisma generate worked for me
This is a bug in child_process.fork. I can reproduce it by running node's parallel/test-child-process-* test cases.
Edit: I'm seeing a hang when passing dgram sockets to child processes. This may or may not be related. cc @heimskr
In my case, I used to have a wrapper script around Prisma so that Prisma would use Bun-loaded .env, .env.local etc. variables rather than just its own mechanic for loading only .env.
This was it:
import Bun from 'bun';
const argv = [process.argv0, 'node_modules/.bin/prisma', ...process.argv.slice(2)];
const { exitCode } = Bun.spawnSync(argv, {
stdio: ['inherit', 'inherit', 'inherit'],
windowsHide: true
});
process.exitCode = exitCode;
And I had the same hanging issue. In the meantime Bun shell was out so I did this and this behaves virtually the same but does not hang:
import { $ } from 'bun';
const { exitCode } = await $`prisma ${process.argv.slice(2)}`.nothrow();
process.exit(exitCode);
Add an package.json script with ex. "prisma": "bun prisma/run-prisma.ts" and now you can bun prisma <command>!
bun 1.2.5 still met the same issue
Seems strongly correlated to https://github.com/oven-sh/bun/issues/17767 for those running devcontainers or containerized CIs.
This fix works for me:
bunx prisma generate | cat
Found here: https://github.com/prisma/prisma/issues/25730#issuecomment-2717853330