Railpack does not recognise bun

mgranty
PRO

4 months ago

i have a project built with Bun, i tried everything to make it install and build with Bun, but it always says:

↳ Detected Node

↳ Using npm package manager

its a monorepo, i'm trying just to build the frontend right now.

Solved

0 Replies

mgranty
PRO

4 months ago

d66985c9-1e8e-460f-afbd-cdc756eac9f6


mgranty
PRO

4 months ago

tried setting the .env with RAILPACKBUNVERSION="1.2.4", all package.json start with Bun, tried setting the packageManager with Bun


mgranty
PRO

4 months ago

idk what else i can try


4 months ago

bun is detected when there is a bun lock file


mgranty
PRO

4 months ago

so i need to place a bun.lock file inside the frontend folder?

because right now my folder structure is something like

repo
|
|-> frontend
|-> server

where if u run bun i inside repo folder, it downloads the node_modules and create the bun.lock inside repo not inside frontend nor server


mgranty
PRO

4 months ago

if i do cd frontend and then bun i bun just says: Checked 775 installs across 860 packages (no changes) [148.00ms]


mgranty
PRO

4 months ago

no module is downloaded and no bun.lock is created


4 months ago

never use cd it's always a clear sign of incorrect config


mgranty
PRO

4 months ago

i'm not using it on the server


4 months ago

is this an isolated or shared monorepo


mgranty
PRO

4 months ago

isolated


4 months ago

then set your root directory to the desired folder


mgranty
PRO

4 months ago

i did.


4 months ago

screenshot please


mgranty
PRO

4 months ago

1348376587829248000


mgranty
PRO

4 months ago

this right?


4 months ago

yes


4 months ago

do you have a bun lock file in that folder?


mgranty
PRO

4 months ago

nope, because bun will not make one there if working on a monorepo


mgranty
PRO

4 months ago

it builds the bun.lock in the parent folder


mgranty
PRO

4 months ago

i can try copy and pasting the bun lock and commiting it


mgranty
PRO

4 months ago

lets see.. building


mgranty
PRO

4 months ago

it detected Bun


mgranty
PRO

4 months ago

but failed to install the dependencies


mgranty
PRO

4 months ago

bun install --frozen-lockfile
process "bun install --frozen-lockfile" did not complete successfully: exit code: 1

4 months ago

full logs please


4 months ago

why did it not complete successfully


mgranty
PRO

4 months ago

the bookmarlet is not working, let me copy it manually


mgranty
PRO

4 months ago

install mise packages: bun, node ✔ 2s

copy package.json

copy package.json ✔ 52ms

copy bun.lock

copy bun.lock ✔ 13ms

bun install --frozen-lockfile

docker-image://ghcr.io/railwayapp/railpack-runtime:latest ✔ 0ms – CACHED

copy /mise/shims

copy /mise/shims ✔ 12ms

bun install v1.2.4 (fd9a5ea6)

Resolving dependencies

Resolved, downloaded and extracted [66]

error: lockfile had changes, but lockfile is frozen
note: try re-running without --frozen-lockfile and commit the updated lockfile

✕ bun install --frozen-lockfile
process "bun install --frozen-lockfile" did not complete successfully: exit code: 1

ERROR: failed to solve: process "bun install --frozen-lockfile" did not complete successfully: exit code: 1


4 months ago

error: lockfile had changes, but lockfile is frozen
note: try re-running without --frozen-lockfile and commit the updated lockfile

mgranty
PRO

4 months ago

hmmm


mgranty
PRO

4 months ago

i will probably try instead of setting the root directory, i will do

clone the repo, execute bun install at repo root, enter frontend folder, build, run start command from frontend folder


mgranty
PRO

4 months ago

must be a bug with bun


4 months ago

please do not do any of that, you need a bun lock file in the frontend folder that is frozen to the packages in the frontend folder, please do not over think this


mgranty
PRO

4 months ago

yeah it worked, kinda of hassle actually because bun does not allow me to generate a lockfile only for the frontend


mgranty
PRO

4 months ago

thanks


mgranty
PRO

4 months ago

solved


4 months ago

!s


Status changed to Solved brody 4 months ago