R
Railway12mo ago
Harris

Enabling bun on shared monorepo (turborepo) when using npm as package manager?

Hi all! I use NPM as my package manager for my shared monorepo (turborepo), and because of that I don't think Nix detects/enables bun? I get an error saying it can't be found when trying to startup my backend websocket server.
No description
Solution:
add a service variable NIXPACKS_CONFIG_FILE set to /apps/ws_server/nixpacks.toml cancel the auto deploy add a nixpacks.toml file to the ws_server folder with this in it ```toml [phases.setup]...
Jump to solution
29 Replies
Percy
Percy12mo ago
Project ID: f0b123dd-49d4-4bfc-b063-9a5238f876ef
Harris
Harris12mo ago
Railway
404 - Page not found
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
Brody
Brody12mo ago
would it be possible for you to share your repo?
Harris
Harris12mo ago
What's your github? I can add you as a reader if that helps
Brody
Brody12mo ago
it sure does, brody192
Brody
Brody12mo ago
what app do you want to run with bun?
Harris
Harris12mo ago
my websocket server apps/ws_server
Brody
Brody12mo ago
are you deploying all 3 of these apps to railway?
Harris
Harris12mo ago
no, only the websocket server, the web app is a nextjs application deployed on vercel, and experiments is just various scripts for me to try different things in a dev environment using the codebase (not to be deployed) I have the build and start commands filter accordingly turbo run build --filter=ws_server and turbo run start --filter=ws_server should only build the deps for ws_server from what I understand
Brody
Brody12mo ago
and you set those in the service settings?
Harris
Harris12mo ago
here right?
No description
No description
Brody
Brody12mo ago
yeah thats good, let me see what i can whip up, few minutes please
Harris
Harris12mo ago
(slightly different question but will the round-robin load balancer break ws connections once they've been established and upgraded?)
No description
Brody
Brody12mo ago
i cant see how they would, upgrades arent new connections are they?
Harris
Harris12mo ago
gotcha, just double checking, i had a lot of reliability issues with the websockets a month ago when i first launched and wasn't sure if cloudflare or railway load balancer could affect things this is my overhaul / rewrite that I'm bringing online great, ty <a:party_blob:1003159778480095283>
Brody
Brody12mo ago
you want the latest bun right?
Harris
Harris12mo ago
yup! bun
Solution
Brody
Brody12mo ago
add a service variable NIXPACKS_CONFIG_FILE set to /apps/ws_server/nixpacks.toml cancel the auto deploy add a nixpacks.toml file to the ws_server folder with this in it
[phases.setup]
nixpkgsArchive = '231b230513b81db80821be631f2e395e26a21f16' # https://github.com/NixOS/nixpkgs/commit/231b230513b81db80821be631f2e395e26a21f16
nixPkgs = ['...', 'bun']
[phases.setup]
nixpkgsArchive = '231b230513b81db80821be631f2e395e26a21f16' # https://github.com/NixOS/nixpkgs/commit/231b230513b81db80821be631f2e395e26a21f16
nixPkgs = ['...', 'bun']
Brody
Brody12mo ago
not tested, so let me know if you run into any issues
Harris
Harris12mo ago
pushed, waiting for deploy bunUwU
Brody
Brody12mo ago
keep me posted
Harris
Harris12mo ago
DiscoDog
No description
Brody
Brody12mo ago
woohoo we in business!!
Harris
Harris12mo ago
railway
Brody
Brody12mo ago
all set?
Harris
Harris12mo ago
all set, thank you!
Brody
Brody12mo ago
no problem! feel free to remove me from the repo when you want
Harris
Harris12mo ago
will do, thanks for the help salute
Want results from more Discord servers?
Add your server