Bun 1.0 on railway
I am spinning up a simple bun app with 1 file in it. But for some reason all of my builds are failing.
I am using
bun build ./index.tsx --outdir ./build
from bun's documentation to build.
This is my service ID: b741e4ae-cac8-410f-a15a-be6e2551fa96
Any help would be appreciated.56 Replies
Project ID:
b741e4ae-cac8-410f-a15a-be6e2551fa96
just directly run index.tsx with bun, it supports typescript
And this is the build command or the start?
start in the package json
do you have theese empty?
I do now, before I had
bun build
and bun index.ts
theretry adding only start in package and leaving those empty
So add, "start package.json" for the start command? Or do I put
bun ./index.tsx
because I have tried those and they failedcan you send your package.json?
have you tried deploying it like this?
I have been trying with this package.json the whole time
have the same settings and it works for me
have you initialized with bun init?
If that doesn't work, you could try removing all of your custom configuration.
Make sure you've run
bun install
and are committing your bun.lockb
.I have run bun init, and bun run index along with bun install. I have it working just fine on my local.
This is the error from railway
#10 0.237 /bin/bash: line 1: npm: command not found
#10 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 127
Had bun been updated to 1 in railway yet?
I’m still running my own dockerfile because of how out of date it was last time I checked.
Also why are you doing a build and not just bun run?
Hi, where should I put bun run? In the start command?
Yes.
That’s what you’re using locally, no?
And that would be the start command?
Yep. That’s all I use for my bun projects
It is still failing with
ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 127
There’s something you’re missing here. Npm shouldn’t be getting called?
Does it show the bun version in the railway logs by chance?
It does not
This is all it says filtering for bun
This is an old project that I am converting to bun, it could be that is the issue.
Although I created a new project and it also failed to build
https://discord.com/channels/713503345364697088/1150193137944363028/1150193587431149679 <-- how to get bun 1.0
does it run locally?
It does, I looked at the link and I don't have node in my package.json
okay, try using that newer nixpack and see if that helps
otherwise you could always add a Dockerfile similar to this. might need to change a few things.
still failing with
lol why it it using npm 🤦♀️
@Brody is the nixpack for bun using npm? 🤔
I just added the .toml file, is there a way to change it from there?
just looks like nixpacks is detecting node instead of bun
@.dylangm do you a commited bun lock file in your repo? 🤔
send your full build logs please
https://bookmarklets.up.railway.app/log-downloader/
no
please follow the 3 steps
My browser isn't letting me add it as a bookmarklet, it's just working like a usual bookmark
You dragged the "Download Logs" button to your bookmarks bar?
I feel like the link could be more clear for idiots like me
Drag this link to your bookmarks barbut hey congrats
lol what. nixpacks you're drunk.
║ setup │ bun ║ ║───────────────────────────────║ ║ install │ npm ci ║
hrrrm
what indeed
You have no custom configuration whatsoever?
any railway.json?
any nixpacks.toml?
anything in the service settings?
"maybe" 😅
Only added the .toml file luna suggested,
[phases.setup]
nixpkgsArchive = 'c054b2a07bce2be3b85fed85f45aea6a4b97f5cc'
hmmm
There's no railway.json in my project, here is the repo https://github.com/DylanBozarth/Andromeda-Backend
GitHub
GitHub - DylanBozarth/Andromeda-Backend
Contribute to DylanBozarth/Andromeda-Backend development by creating an account on GitHub.
Remove package-lock.json
i was typing that lol
speed
the instant brain sync 😆
also you'll likely want to set the port to use
process.env.PORT
not hardcode it to 2999
.Wow, it looks like it worked.
So was the package-lock left over from the node project?
yep
Wow, I tried everything but that because I'm so used to seeing that in a project
luna is right, this is important, please dont forget
Thank you all for your help.