Closed sum117 closed 4 months ago
With bun 1.0.31, prisma generate
does not work with a non-trivial schema already in docker context, hanging without exiting.
# bunx prisma generate
Prisma schema loaded from prisma/schema.prisma
All subsequent prisma generate
commands after interrupting the first process exit silently.
@Jarred-Sumner I'm still getting issues where Prisma silently fails, shouldn't this issue be open?
no output or anything.
is there anything that Bun can do to atleast show some info while this isnt fixed? i've spent 2hours today trying to debug this.
and also can confirm, with node binary prisma works without any problem.
yeah, there is no output running bunx prisma migrate deploy still.
I wasted so many times on this, I hope we can get better solutions soon 😄
I am also having this issue
This issue is still present in v1.1.13. @Jarred-Sumner can we reopen this?
If anyone is looking for a sample Dockerfile to use before this is fixed, this one worked for me:
# Set Bun and Node version
ARG BUN_VERSION=1.1.13
ARG NODE_VERSION=20.12.2
FROM imbios/bun-node:${BUN_VERSION}-${NODE_VERSION}-slim
# Set production environment
ENV NODE_ENV="production"
# Bun app lives here
WORKDIR /app
# Copy app files to app directory
COPY . .
# Install node modules
RUN bun install
# Generate Prisma Client
RUN bun prisma generate
# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD [ "bun", "run", "start" ]
This image contains both bun and node.js. The slim
variant strips out all the unnecessary files. Good luck traveler :)
I can confirm this is still an issue. bunx prisma -v
, bunx prisma generate
and most other commands fail silently.
Adding COPY --from=node:20 /usr/local/bin/node /usr/local/bin/node
to the docker file solved the issue for now.
I believe it works starting from version 1.1.13 up to .16. Remember Prisma is a devDependency so trying to run that code in production should fail.
Remember Prisma is a devDependency so trying to run that code in production should fail.
Mostly yes. But the migrations are also a production concern and bunx prisma migration deploy
fails as well.
Well yes but you're still trying to use a program that's non existent due to the environment you're in (Prisma in production). One way could be to copy the migrations SQL file(s) to a location where you can directly execute it into the database. This is usually what happens when deploying to the cloud anyways
To those of you running into this issue in more recent versions of Bun -- please provide some kind of reproduction and open a new issue. The original cause was fixed (and I've manually verified it continues to work in a simple case), but that means we need more information in order to address any new issues you're running into.
Also, if you're using Alpine Linux, it will likely not work until #918 is addressed.
What version of Bun is running?
1.0.1+31aec4ebe325982fc0ef27498984b0ad9969162b
What platform is your computer?
Microsoft Windows NT 10.0.22621.0 x64
What steps can reproduce the bug?
Docker:
WSL:
Install WSL normally...
Make bun installation inside Ubuntu.
Try to follow this exact guide: https://bun.sh/guides/ecosystem/prisma
What is the expected behavior?
Prisma installs normally
What do you see instead?
This, download never finishes:
Additional information
No response