R
Railway13mo 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
Percy13mo ago
Project ID: f0b123dd-49d4-4bfc-b063-9a5238f876ef
Harris
HarrisOP13mo 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
Brody13mo ago
would it be possible for you to share your repo?
Harris
HarrisOP13mo ago
What's your github? I can add you as a reader if that helps
Brody
Brody13mo ago
it sure does, brody192
Brody
Brody13mo ago
what app do you want to run with bun?
Harris
HarrisOP13mo ago
my websocket server apps/ws_server
Brody
Brody13mo ago
are you deploying all 3 of these apps to railway?
Harris
HarrisOP13mo 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
Brody13mo ago
and you set those in the service settings?
Harris
HarrisOP13mo ago
here right?
No description
No description
Brody
Brody13mo ago
yeah thats good, let me see what i can whip up, few minutes please
Harris
HarrisOP13mo ago
(slightly different question but will the round-robin load balancer break ws connections once they've been established and upgraded?)
No description
Brody
Brody13mo ago
i cant see how they would, upgrades arent new connections are they?
Harris
HarrisOP13mo 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
Brody13mo ago
you want the latest bun right?
Harris
HarrisOP13mo ago
yup! bun
Solution
Brody
Brody13mo 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
Brody13mo ago
not tested, so let me know if you run into any issues
Harris
HarrisOP13mo ago
pushed, waiting for deploy bunUwU
Brody
Brody13mo ago
keep me posted
Harris
HarrisOP13mo ago
DiscoDog
No description
Brody
Brody13mo ago
woohoo we in business!!
Harris
HarrisOP13mo ago
railway
Brody
Brody13mo ago
all set?
Harris
HarrisOP13mo ago
all set, thank you!
Brody
Brody13mo ago
no problem! feel free to remove me from the repo when you want
Harris
HarrisOP13mo ago
will do, thanks for the help salute
Want results from more Discord servers?
Add your server