R
Railway

✋|help

deploy bun 1.0 project

Vvergeilt9/9/2023
does anyone know if and how thats possible on railway currently?
BBrody9/9/2023
try adding this as a nixpacks.toml file to your project
[phases.setup]
nixpkgsArchive = 'c054b2a07bce2be3b85fed85f45aea6a4b97f5cc'

reference https://github.com/NixOS/nixpkgs/commit/c054b2a07bce2be3b85fed85f45aea6a4b97f5cc
Vvergeilt9/9/2023
i will try that
thank you
it failed 😦
BBrody9/9/2023
logs please
Vvergeilt9/9/2023
#12 ERROR: process "/bin/bash -ol pipefail -c bun build" did not complete successfully: exit code: 1

-----

> [stage-0  8/10] RUN --mount=type=cache,id=s/e19bc981-d4b3-4d83-95f8-894c7442cd72-node_modules/cache,target=/app/node_modules/.cache bun build:

0.266   bun build ./src/index.ts --outfile=bundle.js

0.266   bun build --minify --splitting --outdir=out ./index.jsx ./lib/worker.ts

0.266

 

0.266   Bundle code to be run in Bun (reduces server startup time)

0.266   bun build --target=bun ./server.ts --outfile=server.js

0.266

0.266   Creating a standalone executable (see https://bun.sh/docs/bundler/executables)

0.266   bun build --compile ./cli.ts --outfile=my-app

0.266

0.266 A full list of flags is available at https://bun.sh/docs/bundler

-----

Dockerfile:24

-------------------

22 |     # build phase

23 |     COPY . /app/.

24 | >>> RUN --mount=type=cache,id=s/e19bc981-d4b3-4d83-95f8-894c7442cd72-node_modules/cache,target=/app/node_modules/.cache bun build

 

25 |

26 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c bun build" did not complete successfully: exit code: 1

 

Error: Docker build failed

can i provide a Project ID afterwards Maybe that would be easier for you?
BBrody9/9/2023
please enclose the logs in triple backticks
Vvergeilt9/9/2023
done
BBrody9/9/2023
full build logs please
Vvergeilt9/9/2023
 

#10 1.108  + @sveltejs/adapter-auto@2.1.0

#10 1.108  + @sveltejs/kit@1.24.1

#10 1.108  + autoprefixer@10.4.15

#10 1.108  + postcss@8.4.29

#10 1.108  + svelte@4.2.0

#10 1.108  + svelte-adapter-bun@0.5.0

#10 1.108  + tailwindcss@3.3.3

#10 1.108  + vite@4.4.9

 

#10 1.108  + @tailwindcss/forms@0.5.6

#10 1.108

#10 1.108  141 packages installed [829.00ms]

 

#10 DONE 1.2s

 

 

#11 [stage-0  7/10] COPY . /app/.

#11 DONE 0.0s

 

#12 [stage-0  8/10] RUN --mount=type=cache,id=s/e19bc981-d4b3-4d83-95f8-894c7442cd72-node_modules/cache,target=/app/node_modules/.cache bun build

 

#12 0.266 bun build v1.0.0 (822a00c4)

#12 0.266 error: Missing entrypoints. What would you like to bundle?

#12 0.266

#12 0.266 Usage: bun build [flags] [...entrypoints]

#12 0.266

#12 0.266 Common Flags:

#12 0.266   --outfile            Write the output to a specific file (default: stdout)

#12 0.266   --outdir             Write the output to a directory (required for splitting)

#12 0.266   --minify             Enable all minification flags

#12 0.266   --minify-whitespace  Remove unneeded whitespace

 

#12 0.266   --minify-syntax      Transform code to use less syntax

#12 0.266   --minify-identifiers Shorten variable names

#12 0.266   --sourcemap          Generate sourcemaps

#12 0.266                        ("none", "inline", or "external")

#12 0.266   --target             The intended execution environment for the bundle.

#12 0.266                        ("browser", "bun" or "node")

#12 0.266   --splitting          Enable code splitting (requires --outdir)

#12 0.266

#12 0.266 Examples:

#12 0.266   Frontend web apps:

#12 0.266   bun build ./src/index.ts --outfile=bundle.js

#12 0.266   bun build --minify --splitting --outdir=out ./index.jsx ./lib/worker.ts

#12 0.266

#12 0.266   Bundle code to be run in Bun (reduces server startup time)

#12 0.266   bun build --target=bun ./server.ts --outfile=server.js

#12 0.266

#12 0.266   Creating a standalone executable (see https://bun.sh/docs/bundler/executables)

#12 0.266   bun build --compile ./cli.ts --outfile=my-app

#12 0.266

#12 0.266 A full list of flags is available at https://bun.sh/docs/bundler

 

#12 ERROR: process "/bin/bash -ol pipefail -c bun build" did not complete successfully: exit code: 1

-----

> [stage-0  8/10] RUN --mount=type=cache,id=s/e19bc981-d4b3-4d83-95f8-894c7442cd72-node_modules/cache,target=/app/node_modules/.cache bun build:

0.266   bun build ./src/index.ts --outfile=bundle.js

0.266   bun build --minify --splitting --outdir=out ./index.jsx ./lib/worker.ts

0.266

 

0.266   Bundle code to be run in Bun (reduces server startup time)

0.266   bun build --target=bun ./server.ts --outfile=server.js

0.266

0.266   Creating a standalone executable (see https://bun.sh/docs/bundler/executables)

0.266   bun build --compile ./cli.ts --outfile=my-app

0.266

0.266 A full list of flags is available at https://bun.sh/docs/bundler

-----

Dockerfile:24

-------------------

22 |     # build phase

23 |     COPY . /app/.

24 | >>> RUN --mount=type=cache,id=s/e19bc981-d4b3-4d83-95f8-894c7442cd72-node_modules/cache,target=/app/node_modules/.cache bun build

 

25 |

26 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c bun build" did not complete successfully: exit code: 1

 

Error: Docker build failed

 

ok for some reason i cant copy everything
BBrody9/9/2023
that will do
looks like that error output gives you a pretty good idea of how to fix this build issue?
Vvergeilt9/9/2023
im not sure what way would work for railway
BBrody9/9/2023
so what kind of app is this?
Vvergeilt9/9/2023
a svelte-kit full stack app
BBrody9/9/2023
do you develop with bun 1.0 locally?
Vvergeilt9/9/2023
yep
BBrody9/9/2023
vite + sveltekit?
Vvergeilt9/9/2023
yes
BBrody9/9/2023
send me the scripts section of your package.json
Vvergeilt9/9/2023
 "scripts": {
    "dev": "vite dev",
    "build": "vite build",
    "preview": "vite preview"
  },
BBrody9/9/2023
can you run bun build locally without issue?
Vvergeilt9/9/2023
oh no it throws the same
missing entrypoints
BBrody9/9/2023
well if it doesnt work locally its unlikely to work on railway, get it working locally first, let me know when you have that done 🙂
Vvergeilt9/9/2023
alright
oh nvm it actually works just the command is bun run build and not bun build
BBrody9/9/2023
cool, also you seem to be missing a start command?
Vvergeilt9/9/2023
uhm yeah
BBrody9/9/2023
youre gonna need one lol
Vvergeilt9/9/2023
good idea
i think it works now
BBrody9/9/2023
what was the start command you are using now
Vvergeilt9/9/2023
"start": "node ./build/index.js"
and then bun run start
BBrody9/9/2023
bruh
Vvergeilt9/9/2023
i think thats how you do it with svelte kit right
BBrody9/9/2023
you dont see what you did wrong?
Vvergeilt9/9/2023
uhm no
what did i do wrong
it works i think?
BBrody9/9/2023
"start": "node ./build/index.js"
# node
Vvergeilt9/9/2023
😂
well
BBrody9/9/2023
thought you wanted to use bun
Vvergeilt9/9/2023
i mean
yeah
XD
BBrody9/9/2023
see what you did wrong now? lol
Vvergeilt9/9/2023
yes
thanks
lmao
im too tired
BBrody9/9/2023
so tired your eyes are fully closed
Vvergeilt9/9/2023
no i just copy pasted it from another project forgetting that i use bun now instead of node 😂
thanks for the help @Brody
BBrody9/9/2023
well does it work with bun in place of node?
Vvergeilt9/9/2023
yes
BBrody9/9/2023
awsome
CChen9/11/2023
do we need this?
BBrody9/11/2023
to use bun 1.0, yes, otherwise some bun 0.4x version will be used
Vvergeilt9/17/2023
is this automatically using the latest version for example 1.0.2 now ?
BBrody9/17/2023
no, that fixes it to 1.0
add this (or update the archive hash) in your nixpacks.toml to fix the bun version to 1.0.2
referance: https://github.com/NixOS/nixpkgs/commit/d68b3b0c914aea10eee7cf2e59ef44e39bc221c9
[phases.setup]
  nixpkgsArchive = 'd68b3b0c914aea10eee7cf2e59ef44e39bc221c9' # https://github.com/NixOS/nixpkgs/commit/d68b3b0c914aea10eee7cf2e59ef44e39bc221c9

Looking for more? Join the community!

Recommended Posts
Random CPU spike and unresponsive serverWe switched from Vercel to Railway one week ago, and everything was going well until today. For somIncorrect hostname with private networkingI've set `mongo-2.railway.internal` (or mongo-2) as the endpoint name for private networking on the Do I need to configure anything in the Docker Image to support TCP proxy?For some reason I can't use the TCP proxy in the Minecraft Server template, I get "connection reset"Cron JobsHey everyone. I'm moving from Vercel to Railway so this is my first Railway project. I'm trying to iHow to connect FastAPI with Planetscale (mysqlclient error)Hey, how are you guys doing? I have a backend on Railway who is running with FastAPI (using this teHobby PlanI have a Discord bot which needs to be hosted, I had it hosted on railway before the recent pricing AttributeError: 'DatabaseWrapper' object has no attribute 'set_schema'I'm using django with mutlitenants using the package django-tenants==3.5.0 When i deployed the app tHosting errori am hosting my discord bot written in python using nextcord library and when i deploy it then it shDeploy angular applicationerror: ```2 minutes ago via GitHub Init main View Logs Removed Deployed 3 minutes ago vimongo on railwayI am trying to get mongo v7 up and running on railway. When using default options, I am getting follTCP Proxy timeoutI'm trying to start a Redis server with the official Docker image from Docker Hub with #TCP + LogginHow to move from Working Localhost w/ Django Websockets to Railway production?I had a functioning django websocket fantasy draft on my local host using daphne and redis. However,There's suddenly two new random columns in my database??I went in and checked my railway dashboard and to my surprise there's two new completely random dataRailway having issues with Mongoose NPM package???Locally my code works fine, I can connect to Mongo using Mongoose no issues but when on Railway it rNo VAT taxes on invoicesHello everyone I've just joined this server. On my invoices, I don't see any VAT tax prices includeIssue with mounting volumeHello, I have an instance of n8n running, I need to attach a volume to keep community node persistenPin memory usageI'm running a service that scales memory usage unpredictably and quickly, and it crashes in these caVariables redeploy infoSometimes when I don't have an active deployment and I change the variables it triggers a redeploy bStatic IPsIs there any updates for static IPs? I would love to use Railway for a Discord bot so everything is Prebuilt Mqtt Service and PortsLooking for some guidance. Currently have a couple different services in my project, including a pos