R
Railway•15mo ago
Cookies

BUN 1.0 + Astro

Has anyone tried to deploy a Bun app yet? I am getting this error. ERROR: failed to solve: process "/bin/bash -ol pipefail -c bun run build" did not complete successfully: exit code: 127 I assume that is because Railway hasn't got to this yet with Bun being so new?
26 Replies
Percy
Percy•15mo ago
Project ID: 43265ce1-d2dd-42a3-a5c7-1dba1da63c58
Cookies
CookiesOP•15mo ago
43265ce1-d2dd-42a3-a5c7-1dba1da63c58
fedev
fedev•15mo ago
I have just deployed a bun app and it's working fine (not with astro tho) whats you package json
Cookies
CookiesOP•15mo ago
{
"name": "@example/minimal",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"devDependencies": {
"@astrojs/sitemap": "^1.0.0",
"@astrojs/tailwind": "^1.0.0",
"astro": "^1.0.0",
"astro-robots-txt": "^0.3.8"
}
}
{
"name": "@example/minimal",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"devDependencies": {
"@astrojs/sitemap": "^1.0.0",
"@astrojs/tailwind": "^1.0.0",
"astro": "^1.0.0",
"astro-robots-txt": "^0.3.8"
}
}
I got it working on another service by overriding the build command so I'm assuming i need to make a custom nixpack with the commands
fedev
fedev•15mo ago
Astro Documentation
Use Bun with Astro
Learn how to use Bun with your Astro site.
fedev
fedev•15mo ago
maybe try with bun --bun astro build and start: bun --bun astro dev
Cookies
CookiesOP•15mo ago
I got a different error but still failed just failed with bun --bun astro build failed its failing to build with docker ok build command = bun install new error :
$ astro build

/bin/bash: line 1: astro: command not found

error: script "astro" exited with code 127
$ astro build

/bin/bash: line 1: astro: command not found

error: script "astro" exited with code 127
fedev
fedev•15mo ago
Tried but this is the main problem
No description
fedev
fedev•15mo ago
And I think nixpacks doesent support that version
Cookies
CookiesOP•15mo ago
thank you for trying
Brody
Brody•15mo ago
cookies, do you develop this astro app with bun 1.0 locally?
Cookies
CookiesOP•15mo ago
i do and it works perfectly on my machine and on another well known platoform i have it deployed
Brody
Brody•15mo ago
well known platform lol what is the command you run locally to build your app
Cookies
CookiesOP•15mo ago
Vercel 🙂
Brody
Brody•15mo ago
i will say vercel is far better suited to host frontend websites on railway you would need to use astro's node adapter and astro calls its node adapter a "preview server"
Cookies
CookiesOP•15mo ago
bunx create-astro created all my source files ahhh I did not try bun --bun astro preview
Brody
Brody•15mo ago
can i ask why youd want to run an astro site on railway? railway is more geared towards backend
Cookies
CookiesOP•15mo ago
I run my django and next.js apps on here. Didn't realize railway was not suited for this type of thing since i've had nearly no issues with it till trying to learn bun and try out astro
Brody
Brody•15mo ago
well its more so its not suited for it without work on your part as youve proven by opening this thread and saying it worked on vercel without issues
Cookies
CookiesOP•15mo ago
oh no it didnt work on vercel without issues. I still had to override the build commands I knew there would be issues. Even Railway's documents say they support BUN 1.0 just its new
Brody
Brody•15mo ago
either way, youd need to use the node adapter and then run the resulting server entrypoint with bun https://docs.astro.build/en/guides/integrations-guide/node/
Cookies
CookiesOP•15mo ago
Bun is a direct replacement for Node though or maybe i interpreted that incorrectly
Brody
Brody•15mo ago
astro doesnt have a bun adapter, youd need to build with the node adapter and run it with bun and i dont see why you couldn't build the node adapter with bun too
Cookies
CookiesOP•15mo ago
thats just for server side rendering though right?
Brody
Brody•15mo ago
yes or hybrid
Cookies
CookiesOP•15mo ago
hmm i'll continue to research thi, thanks
Want results from more Discord servers?
Add your server