a year ago
When trying to build nixpacks with bun and prisma using this config:
# nixpacks.toml
[phases.setup]
nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'
[start]
cmd = "bunx prisma migrate deploy && bunx prisma generate && bun run start"
I get the following error:
0 Replies
a year ago
try this -
[phases.setup]
nixLibs = ['...', 'openssl']
nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'
[start]
cmd = "bunx prisma migrate deploy && bunx prisma generate && bun run start"
a year ago
n/a
a year ago
Returns this with, and says schema error but there is no error
a year ago
no more openssl issue though?
a year ago
No
a year ago
Running from the docker desktop and this is what i get
a year ago
okay try adding this to your schema file -
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-1.1.x", "debian-openssl-3.0.x"]
}
a year ago
Alr
a year ago
Same thing Error: Schema engine error:
a year ago
no error is returned…
a year ago
i assume this works locally without docker?
a year ago
Yes, when i just run bun dev
it works without any issues
a year ago
a year ago
but bun dev is not what is being ran with the image
a year ago
nope, the start command wich is runned at the end is bun start
a year ago
wich is just the dev cmd without --watch
a year ago
run the entire start command locally outside of docker
a year ago
alr 2 sec
a year ago
That worked
a year ago
what command did you run
a year ago
the start command from the nixspacks.toml file
a year ago
including the deploy and generate part?
a year ago
Yes
a year ago
should deploy be ran before generate?
a year ago
We can try that
a year ago
its first time i use prisma with migrate
a year ago
that was just a y/n question haha
a year ago
yes
a year ago
Now there is something. It seems the migrate cmd fails
a year ago
lets try without it
a year ago
what version of prisma are you using
a year ago
v5.13.0
a year ago
but it works
a year ago
removed the migrate cmd, then there is no issues
a year ago
send me your nixpacks build table please
a year ago
[phases.setup]
nixLibs = ['...', 'openssl']
nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'
[start]
cmd = "bunx prisma generate && bun run start"
a year ago
thats your nixpacks.toml file
a year ago
whats the table ?
a year ago
in the build logs
a year ago
oh yeah sure 2 sec
a year ago
nixpacks build ./
╔═════════════════ Nixpacks v1.21.3 ═════════════════╗
║ setup │ nodejs_18, bun, openssl ║
║────────────────────────────────────────────────────║
║ install │ bun i --no-save ║
║────────────────────────────────────────────────────║
║ start │ bunx prisma generate && bun run start ║
╚════════════════════════════════════════════════════╝
[+] Building 0.8s (13/13) FINISHED docker:desktop-linux
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 900B 0.0s
=> [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1711411379 0.6s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 77B 0.0s
=> [stage-0 1/8] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1711411379@sha256:c25fa55357 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 972.89kB 0.1s
=> CACHED [stage-0 2/8] WORKDIR /app/ 0.0s
=> CACHED [stage-0 3/8] COPY .nixpacks/nixpkgs-d05592ea7e9656648093dfe0e817819486bd50 0.0s
=> CACHED [stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-d05592ea7e9656648093dfe0e81 0.0s
=> CACHED [stage-0 5/8] COPY . /app/. 0.0s
=> CACHED [stage-0 6/8] RUN --mount=type=cache,id=5WCYsrDReI-/root/bun,target=/root/. 0.0s
=> CACHED [stage-0 7/8] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.pr 0.0s
=> CACHED [stage-0 8/8] COPY . /app 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:d98fa8febb83d99540956201d73729b448afd32a698cd9b7623c715822 0.0s
=> => naming to docker.io/library/a7fa79db-ff3c-433f-939e-2dfaf0f898ba 0.0s
View build details: docker-desktop://dashboard/build/desktop-linux/desktop-linux/j7qqwbqssk0ofzpdr0fzg135c
What's Next?
View a summary of image vulnerabilities and recommendations → docker scout quickview
=== Successfully Built! ===
Run:
docker run -it a7fa79db-ff3c-433f-939e-2dfaf0f898ba
a year ago
we are the only two people here, theres no need for the ping replies
a year ago
its beacuse i forgot to turn it off when i reply
a year ago
theres no need to reply to a specific message, we are the only people here
a year ago
You right
a year ago
what node version do you have installed locally?
a year ago
anyways i can confirm it also works on railway
a year ago
the latest version
a year ago
thats not really an answer haha
a year ago
you mean bun?
a year ago
i mean node
a year ago
I'm using version 22
a year ago
and what bun version
a year ago
1.1.6
a year ago
can you try downgrading to node 18 and bun 1.1.4, deleteing the node_modules folder and running the same install and start commands as nixpacks does (locally outside of docker)
a year ago
With the migrate cmd also? Beacuse it works all now?
a year ago
Beacuse i removed the migrate cmd
a year ago
well you would want the migrate command
a year ago
Yeah true
a year ago
how to downgrade to bun v1.1.4?
a year ago
remove your current version of bun and install 1.1.4
a year ago
😎
a year ago
i run this command but bun is still there somehow