Prisma Nickpacks with Bun error

2 years 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

2 years ago

try this -

[phases.setup]
    nixLibs = ['...', 'openssl']
    nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'

[start]
cmd = "bunx prisma migrate deploy && bunx prisma generate && bun run start"

2 years ago

n/a


2 years ago

Returns this with, and says schema error but there is no error

1234164540791591200


2 years ago

no more openssl issue though?


2 years ago

No


2 years ago

Running from the docker desktop and this is what i get

1234164821851639800


2 years 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"]
}

2 years ago

Alr


2 years ago

Same thing Error: Schema engine error:


2 years ago

no error is returned…


2 years ago

i assume this works locally without docker?


2 years ago

Yes, when i just run bun dev it works without any issues


2 years ago

1234165661102641200


2 years ago

but bun dev is not what is being ran with the image


2 years ago

nope, the start command wich is runned at the end is bun start


2 years ago

wich is just the dev cmd without --watch


2 years ago

run the entire start command locally outside of docker


2 years ago

alr 2 sec


2 years ago

That worked

1234166155149574100


2 years ago

what command did you run


2 years ago

the start command from the nixspacks.toml file


2 years ago

including the deploy and generate part?


2 years ago

Yes


2 years ago

should deploy be ran before generate?


2 years ago

We can try that


2 years ago

its first time i use prisma with migrate


2 years ago

that was just a y/n question haha


2 years ago

yes


2 years ago

Now there is something. It seems the migrate cmd fails


2 years ago

lets try without it


2 years ago

what version of prisma are you using


2 years ago

v5.13.0


2 years ago

but it works


2 years ago

removed the migrate cmd, then there is no issues


2 years ago

send me your nixpacks build table please


2 years ago

[phases.setup]
    nixLibs = ['...', 'openssl']
    nixpkgsArchive = 'd05592ea7e9656648093dfe0e817819486bd5054'

[start]
cmd = "bunx prisma generate && bun run start"

2 years ago

thats your nixpacks.toml file


2 years ago

whats the table ?


2 years ago

in the build logs


2 years ago

oh yeah sure 2 sec


2 years 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

2 years ago

we are the only two people here, theres no need for the ping replies


2 years ago

its beacuse i forgot to turn it off when i reply


2 years ago

theres no need to reply to a specific message, we are the only people here


2 years ago

You right


2 years ago

what node version do you have installed locally?


2 years ago

anyways i can confirm it also works on railway


2 years ago

the latest version


2 years ago

thats not really an answer haha


2 years ago

you mean bun?


2 years ago

i mean node


2 years ago

I'm using version 22

1234175283884589000


2 years ago

and what bun version


2 years ago

1.1.6


2 years 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)


2 years ago

With the migrate cmd also? Beacuse it works all now?


2 years ago

Beacuse i removed the migrate cmd


2 years ago

well you would want the migrate command


2 years ago

Yeah true


2 years ago

how to downgrade to bun v1.1.4?


2 years ago

remove your current version of bun and install 1.1.4


2 years ago

😎


2 years ago

i run this command but bun is still there somehow

1234178617630785500


Loading...