Bun (SvelteKit) app won't build with Railpack
henrikvtcodes
HOBBYOP

4 months ago

I have a sveltekit app that uses Bun. When switched over to Railpack, it fails to build with this error:

exec /app/node_modules/.bin/bun: exec format error
ERROR: failed to build: failed to solve: process "bun run build" did not complete successfully: exit code: 255
$10 Bounty

3 Replies

henrikvtcodes
HOBBYOP

4 months ago

I got it to work by adding a railway.json file to my repo with this content:

{
    "$schema": "https://railway.com/railway.schema.json",
    "build": {
        "builder": "RAILPACK",
        "buildCommand": "bun svelte-kit sync && bun run build"
    }
}

henrikvtcodes
HOBBYOP

4 months ago

From looking at the build logs, I think before adding that config file, it was trying to bun run build inside the container and the bun executable wasn't resolving properly


iloveitaly
HOBBY

3 months ago

@Henrik do you have a package.json > scripts > build command? Does that work locally?

railPack should pick up the build commands that work for you locally and replicate those within the build process. So I'm curious what went wrong here.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...