#Prisma generate never completes
5 messages · Page 1 of 1 (latest)
I can see you're experiencing an issue where bunx prisma generate hangs indefinitely on certain machines. This is a known issue that has been reported by several users.
Possible Causes and Solutions
1. Missing Node.js Installation
The most common cause of this issue is that Bun requires Node.js to be installed for Prisma generation to work properly. Prisma has dependencies on the Node API that aren't fully compatible with Bun alone.
Solution: Install Node.js on the machines where the command is hanging.
Several users have reported that installing Node.js resolves this issue:
"Had to install
nodeto resolve the issue" Github Issue #25730
"Solved for me: Install NodeJS to Linux" Github Issue #21277
2. Bun Compatibility Issues
There appears to be an underlying compatibility issue between Bun and Prisma's generation process:
"For what it is worth, this could be a bun issue. If you use a docker image with
nodeavailable in the path, the issue goes away. If you forcibly symlinknodebinary to point tobunwithbunx --bun prisma generatethe issue resurfaces. There is some underlying hardcoded dependency on NodeJS within prisma." Github Issue #25730
3. Alternative Approach
If installing Node.js isn't an option, you can try using npm instead of bun to run the generate command:
"works fine if i use npm not bun to run the generate command" Github Issue #25730
Technical Explanation
A Prisma team member explained that Prisma doesn't explicitly start a node process, but uses child_process.fork to execute generator code:
"Prisma doesn't explicitly start a
nodeprocess specifically, it useschild_process.forkand passes it the resolved path togenerator-build/index.jsfrom the@prisma/clientpackage." [Github
Issue #25730](https://github.com/prisma/prisma/issues/25730)
This appears to be causing compatibility issues with Bun's implementation of Node.js APIs.
Try installing Node.js on the problematic machines and run the command again, or alternatively use npx prisma generate instead of bunx prisma generate.
kapa.ai: I've provided information about the issue with bunx prisma generate hanging based on multiple GitHub issues. The most likely solution is installing Node.js on the affected machines, as Prisma has dependencies on Node.js APIs that aren't fully compatible with Bun alone. Let me know if you need any clarification or have additional questions!
🤔 Alright, thanks for letting us know that there's still some help needed. A team member will reply to you shortly.
In the meantime, please let us know any additional info, questions, or which parts of the answer may need clarification.
can you try to pipe prisma generate to cat? bunx --bun prisma generate | cat