bun install fails due to esbuild postinstall script

joshuafcole
PRO

a month ago

Relevant errors:

node: /nix/store/...-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /nix/store/...-icu4c-75.1/lib/libicui18n.so.75) error: postinstall script from "esbuild" exited with 1

=>

 [stage-0 8/13] RUN --mount=type=cache,id=s/.../root/bun,target=/root/.bun cd ./client && pwd && ls && node=bun && bun i --no-save --bun

process "/bin/bash -ol pipefail -c cd ./client && pwd && ls && node=bun && bun i --no-save --bun" did not complete successfully: exit code: 1

Build logs:
```

[Region: us-east4]

May 23 16:35:53

==============

May 23 16:35:53

Using Nixpacks

May 23 16:35:53

==============

May 23 16:35:53

May 23 16:35:53

context: zz5l-G5Wb

May 23 16:35:53

╔══════════════════════════════ Nixpacks v1.38.0 ══════════════════════════════╗

May 23 16:35:53

║ python:setup │ python3, gcc ║

May 23 16:35:53

║──────────────────────────────────────────────────────────────────────────────║

May 23 16:35:53

║ setup │ nodejs_18, bun ║

May 23 16:35:53

║──────────────────────────────────────────────────────────────────────────────║

May 23 16:35:53

║ install │ cd ./client && pwd && ls && node=bun && bun i --no-save --bun ║

May 23 16:35:53

║ │ cd ./server && python scripts/install.py model-server ║

May 23 16:35:53

║──────────────────────────────────────────────────────────────────────────────║

May 23 16:35:53

║ build │ cd ./client/apps/modeler && bun run build ║

May 23 16:35:53

║──────────────────────────────────────────────────────────────────────────────║

May 23 16:35:53

║ start │ cd ./server/model-server && source .venv/bin/activate && ║

May 23 16:35:53

║ │ model-server ║

May 23 16:35:53

╚══════════════════════════════════════════════════════════════════════════════╝

May 23 16:35:53

[internal] load build definition from Dockerfile

May 23 16:35:53

[internal] load build definition from Dockerfile

May 23 16:35:53

[internal] load build definition from Dockerfile 0ms

May 23 16:35:53

[internal] load build definition from Dockerfile

May 23 16:35:53

[internal] load build definition from Dockerfile 10ms

May 23 16:35:53

[internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1745885067

May 23 16:35:53

[internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1745885067 79ms

May 23 16:35:53

[internal] load .dockerignore

May 23 16:35:53

[internal] load .dockerignore 0ms

May 23 16:35:53

[internal] load .dockerignore

May 23 16:35:53

[internal] load .dockerignore 7ms

May 23 16:35:53

[internal] load build context 0ms

May 23 16:35:53

[internal] load build context

May 23 16:35:54

[internal] load build context 503ms

May 23 16:35:54

[stage-0 2/10] WORKDIR /app/ 0ms – CACHED

May 23 16:35:54

[stage-0 3/13] COPY .nixpacks/nixpkgs-bc8f8d1be58e8c8383e683a06e1e1e57893fff87.nix .nixpacks/nixpkgs-bc8f8d1be58e8c8383e683a06e1e1e57893fff87.nix 0ms – CACHED

May 23 16:35:54

[stage-0 4/13] RUN nix-env -if .nixpacks/nixpkgs-bc8f8d1be58e8c8383e683a06e1e1e57893fff87.nix && nix-collect-garbage -d 0ms – CACHED

May 23 16:35:54

[stage-0 5/13] COPY .nixpacks/nixpkgs-f69ae4816bc1b501460ad2c0c63ed0cc4a9b876e.nix .nixpacks/nixpkgs-f69ae4816bc1b501460ad2c0c63ed0cc4a9b876e.nix 0ms – CACHED

May 23 16:35:54

[stage-0 6/13] RUN nix-env -if .nixpacks/nixpkgs-f69ae4816bc1b501460ad2c0c63ed0cc4a9b876e.nix && nix-collect-garbage -d 0ms – CACHED

May 23 16:35:54

[stage-0 7/13] COPY . /app/.

May 23 16:35:54

[stage-0 7/13] COPY . /app/. 245ms

May 23 16:35:54

[stage-0 8/13] RUN --mount=type=cache,id=s/3bb22e78-5635-4880-aa40-3f7a331b2f22-/root/bun,target=/root/.bun cd ./client && pwd && ls && node=bun && bun i --no-save --bun

May 23 16:35:54

/app/client

May 23 16:35:54

CLAUDE.md apps bun.lockb bunfig.toml dprint.json notes package.json packages public src tsconfig.base.json tsconfig.json

May 23 16:35:54

bun install v1.2.10 (db2e7d7f)

May 23 16:35:54

Resolving dependencies

May 23 16:35:55

Resolved, downloaded and extracted [44]

May 23 16:36:02

node: /nix/store/s94fwp43xhzkvw8l8nqslskib99yifzi-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /nix/store/cyjk6kybxlw1ghm3w9nlb114lr3s6221-icu4c-75.1/lib/libicui18n.so.75) error: postinstall script from "esbuild" exited with 1

May 23 16:36:02

✕ [stage-0 8/13] RUN --mount=type=cache,id=s/3bb22e78-5635-4880-aa40-3f7a331b2f22-/root/bun,target=/root/.bun cd ./client && pwd && ls && node=bun && bun i --no-save --bun

process "/bin/bash -ol pipefail -c cd ./client && pwd && ls && node=bun && bun i --no-save --bun" did not complete successfully: exit code: 1

Solved$10 Bounty

7 Replies

a month ago

Hey, can you try switching the builder in your service's settings from Nixpacks to Railpack and see if that fixes the issue? If I am not mistaken, Railpack has better support for Bun than Nixpacks.


joshuafcole
PRO

a month ago

Thanks for the tip! That got me further along. I'm running into an issue with vite build failing in that environment (despite building fine in a clean clone locally), but it's getting past the installation now at least!

```
install apt packages: nodejs

0s

May 23 17:28:25

mkdir /etc/mise

0s

May 23 17:28:25

create mise config

0s

May 23 17:28:25

install mise packages: bun

1s

May 23 17:28:27

copy package.json, /mise/shims, client/package.json, client/apps/modeler/package.json, client/packages/arktk/package.json, client/packages/fixtures/package.json, tools/model-maker/package.json, bun.lockb, client/bun.lockb

0s

May 23 17:28:27

bun install --frozen-lockfile

0s

May 23 17:28:27

copy /mise/installs, /usr/local/bin/mise, /etc/mise/config.toml, /root/.local/state/mise, .

0s

May 23 17:28:28

cd ./client/apps/modeler && bun run build

process "sh -c cd ./client/apps/modeler && bun run build" did not complete successfully: exit code: 1

0s

May 23 17:28:28

$ bunx --bun vite build

May 23 17:28:28

Resolving dependencies

May 23 17:28:28

Resolved, downloaded and extracted [142]

May 23 17:28:29

Saved lockfile

May 23 17:28:29

failed to load config from /app/client/apps/modeler/vite.config.ts

May 23 17:28:29

error during build: undefined
```


a month ago

Hey, are there more logs past the failed to load config from /app/client/apps/modeler/vite.config.ts line, which specify the exact reason/error for why it failed to load the config?


knjsoft
FREE

a month ago

Check the Node.js version to see if it's compatible with Vite.

  • bun cache clean

  • rm bun.lockb

  • bun install


knjsoft

Check the Node.js version to see if it's compatible with Vite.bun cache cleanrm bun.lockbbun install

a month ago

English only please.


uxuz

Hey, are there more logs past the failed to load config from /app/client/apps/modeler/vite.config.ts line, which specify the exact reason/error for why it failed to load the config?

joshuafcole
PRO

a month ago

unfortunately not -- I've had this issue in the past with path resolution issues for vite plugins where that's the sole issue I get back. I'm trying to bisect and see if that'sthe problem here as well now.


uxuz

Hey, can you try switching the builder in your service's settings from Nixpacks to Railpack and see if that fixes the issue? If I am not mistaken, Railpack has better support for Bun than Nixpacks.

joshuafcole
PRO

a month ago

this fixed the root issue I was running into beforehand so I'll accept it now. If I can't get to the bottom of the vite issue I'll start a new thread. Thanks again for the help, all!


Status changed to Solved brody about 1 month ago


bun install fails due to esbuild postinstall script - Railway Help Station