#Prisma generate never completes

5 messages · Page 1 of 1 (latest)

gaunt gullBOT
#

You chose to compile with the bot. One moment while I piece together your answer…

gaunt gullBOT
# gaunt gull You chose to compile with the bot. One moment while I piece together your answer...

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 node to 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 node available in the path, the issue goes away. If you forcibly symlink node binary to point to bun with bunx --bun prisma generate the 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 node process specifically, it uses child_process.fork and passes it the resolved path to generator-build/index.js from the @prisma/client package." [Github

gaunt gullBOT
# gaunt gull You chose to compile with the bot. One moment while I piece together your answer...

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!

gaunt gullBOT
silent bone
#

can you try to pipe prisma generate to cat? bunx --bun prisma generate | cat