Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun support #960

Closed
Screeper11 opened this issue Sep 8, 2023 · 6 comments
Closed

Bun support #960

Screeper11 opened this issue Sep 8, 2023 · 6 comments

Comments

@Screeper11
Copy link

Screeper11 commented Sep 8, 2023

Feature request

Support Bun non-experimentally

Motivation

Bun is no longer in alpha, a confirmed stable support would be a good reason to migrate Bun projects over to Railway.

I think this would consist mostly of testing (and maybe bug fixing), rather than implementing a new feature as it seems to work most of the time already. But confirmation in the docs (after heavy testing) is needed to be able to trust Railway as a host of these projects.

Contribution

No response

@marcfrankel
Copy link

I'll add on to this issue that I just tried to use Bun on Railway and noticed that it installs version 0.4.0, not the new 1.0. It's causing a build fail for me

@sinasab
Copy link

sinasab commented Sep 10, 2023

+1 same issue, looks like there's a workaround (below, worked for me), but ideally this would "just work tm"

from the discord:
image
@ link

mcansh added a commit to mcansh/mcan.sh that referenced this issue Sep 11, 2023
mcansh added a commit to mcansh/mcan.sh that referenced this issue Sep 12, 2023
@mrcnk
Copy link

mrcnk commented Sep 16, 2023

I'm facing a Next.js (with App Router) problem. Not sure if it isn't more of Bun issue though.
It can't find next bin executable.

nixpacks build . --no-cache

╔══════ Nixpacks v1.15.0 ══════╗
║ setup      │ bun             ║
║──────────────────────────────║
║ install    │ bun i --no-save ║
║──────────────────────────────║
║ build      │ bun run build   ║
║──────────────────────────────║
║ start      │ bun run start   ║
╚══════════════════════════════╝

[+] Building 37.4s (12/14)                                             docker:desktop-linux
 => [internal] load build definition from Dockerfile                                   0.0s
 => => transferring dockerfile: 879B                                                   0.0s
 => [internal] load .dockerignore                                                      0.0s
 => => transferring context: 2B                                                        0.0s
 => [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1693872184         0.9s
 => [internal] load build context                                                      7.8s
 => => transferring context: 988.58MB                                                  7.8s
 => [ 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1693872184@sha256:c90dd7da0f96190  0.0s
 => CACHED [ 2/10] WORKDIR /app/                                                       0.0s
 => [ 3/10] COPY .nixpacks/nixpkgs-c636fe7908e2b52713ff7c260a9da233effc5b7f.nix .nixp  0.5s
 => [ 4/10] RUN nix-env -if .nixpacks/nixpkgs-c636fe7908e2b52713ff7c260a9da233effc5b  17.7s
 => [ 5/10] COPY . /app/.                                                              3.1s
 => [ 6/10] RUN  bun i --no-save                                                       3.6s
 => [ 7/10] COPY . /app/.                                                              3.7s
 => ERROR [ 8/10] RUN  bun run build                                                   0.1s
------
 > [ 8/10] RUN  bun run build:
0.095 $ node_modules/.bin/next build
0.097 /bin/bash: line 1: node_modules/.bin/next: No such file or directory
0.097 error: script "build" exited with code 127
------
Dockerfile:24
--------------------
  22 |     # build phase
  23 |     COPY . /app/.
  24 | >>> RUN  bun run build
  25 |
  26 |
--------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c bun run build" did not complete successfully: exit code: 127
Error: Docker build failed

More context: palladians/minaverse#36

@coffee-cup
Copy link
Contributor

Bun 1.0.2 support has been added in 1.15.0. If there is a bug or issue with a specific project, please open another issue

@ctwhome
Copy link

ctwhome commented Feb 16, 2024

Bun 1.0.2 support has been added in 1.15.0. If there is a bug or issue with a specific project, please open another issue

That is fantastic thanks!, it would be useful to add a reference to Bunjs in your documentation, and also make it clear that to recognize a bun app, the directory needs the necessary files created in bun init.

@blankart
Copy link

I'm facing a Next.js (with App Router) problem. Not sure if it isn't more of Bun issue though. It can't find next bin executable.

nixpacks build . --no-cache

╔══════ Nixpacks v1.15.0 ══════╗
║ setup      │ bun             ║
║──────────────────────────────║
║ install    │ bun i --no-save ║
║──────────────────────────────║
║ build      │ bun run build   ║
║──────────────────────────────║
║ start      │ bun run start   ║
╚══════════════════════════════╝

[+] Building 37.4s (12/14)                                             docker:desktop-linux
 => [internal] load build definition from Dockerfile                                   0.0s
 => => transferring dockerfile: 879B                                                   0.0s
 => [internal] load .dockerignore                                                      0.0s
 => => transferring context: 2B                                                        0.0s
 => [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1693872184         0.9s
 => [internal] load build context                                                      7.8s
 => => transferring context: 988.58MB                                                  7.8s
 => [ 1/10] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1693872184@sha256:c90dd7da0f96190  0.0s
 => CACHED [ 2/10] WORKDIR /app/                                                       0.0s
 => [ 3/10] COPY .nixpacks/nixpkgs-c636fe7908e2b52713ff7c260a9da233effc5b7f.nix .nixp  0.5s
 => [ 4/10] RUN nix-env -if .nixpacks/nixpkgs-c636fe7908e2b52713ff7c260a9da233effc5b  17.7s
 => [ 5/10] COPY . /app/.                                                              3.1s
 => [ 6/10] RUN  bun i --no-save                                                       3.6s
 => [ 7/10] COPY . /app/.                                                              3.7s
 => ERROR [ 8/10] RUN  bun run build                                                   0.1s
------
 > [ 8/10] RUN  bun run build:
0.095 $ node_modules/.bin/next build
0.097 /bin/bash: line 1: node_modules/.bin/next: No such file or directory
0.097 error: script "build" exited with code 127
------
Dockerfile:24
--------------------
  22 |     # build phase
  23 |     COPY . /app/.
  24 | >>> RUN  bun run build
  25 |
  26 |
--------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c bun run build" did not complete successfully: exit code: 127
Error: Docker build failed

More context: palladians/minaverse#36

Were you able to solve this issue? I'm getting the same errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants