Bun with turborepo support
Hey guys,
Just switched over to bun from fastify but having some trouble setting it up properly to work with railway.
Im using turborepo and I just want railway to build the elysia app and I added the nixpacks.toml to root. The nextjs app itself is using vercel.
Here is the github repo: https://github.com/DivMode/turbo-test
railway server: 4392cf24-3b39-4f8b-a38b-2a47273c234b
GitHub
GitHub - DivMode/turbo-test: Testing turborepo
Testing turborepo. Contribute to DivMode/turbo-test development by creating an account on GitHub.
19 Replies
Project ID:
4392cf24-3b39-4f8b-a38b-2a47273c234b
for starters, it looks like you are missing a bun lock file, bun won't be automatically detected without a bun lock file
I added the bun.lockb file to root and tried it inside the server but no luck with getting it to work
you have yet to tell us what isn't working
"server:start: sh: 1: bun: not found"
it also trys to start the nextjs app but I do have in the nixfile
ah gotcha, you still have a pnpm lock file, so node is still being detected
Getting this after removing the lockfile but is there a way I can have bo the the pnpm lockfile and use bun?
you want to use pnpm instead of buns package manager? I'm sorry but I don't see the point in that?
what is your usecase for using bun in the first place?
esm and commonjs compatability, was having some trouble with it in fastify, I just want to use bun with elysia as the backend on railway and nextjs app in the frontend with vercel
then the backend being part of the turbo repo is probably only hindering the deployable of this repo
I was hoping to keep everything inside the monorepo. Im assuming that isnt possible at this time?
you can still do a monorepo, but an isolated monorepo would probably work much better for this type of thing
Would love to get it working with turborepo on railway as it simplifies things for me but I guess support for bun isnt really there yet.
to be honest I don't think you will ever be able to just no config deploy this repo how you have it now with pnpm mixed in with bun, that's why I suggested an isolated monorepo
I guess your right, one thing I really liked about the monorepo approach was I could easily share the database schemas and types between frontend and backend.
yeah but you are mixing technologies
Yea, @divmode - sans addtl. Railway features, there wouldn't be a way for us to automatically detect it as you are still pinning some deps via pnpm and cJS. Unless you are giving us a custom build script that you have yourself to rectify the difference, you will need to beat Nixpacks into shape or use a Dockerfile
beautifully said
Using a dockerfile to try and get this to work sounds interesting, ill take a look into it, appreciate your guys input