Skip to content

[Bug]: Current version of nixpacks doesn't work with bun.lock v1 #6195

Closed as duplicate of#6155
@BrokenSwing

Description

@BrokenSwing

Error Message and Logs

When trying to deploy a Bun project I get the error:

--------------------
|     ENV NIXPACKS_PATH=/app/node_modules/.bin:$NIXPACKS_PATH
|     COPY . /app/.
| >>> RUN --mount=type=cache,id=k4kc0og00kc00wgok04g8scw-/root/bun,target=/root/.bun bun i --no-save
|     # build phase 
-------------------- 
ERROR: failed to solve: process "/bin/bash -ol pipefail -c bun install --ignore-scripts" did not complete successfully: exit code: 132

After some digging and by re-using the same version of nixpacks that Coolify is using, I pin-pointed the error to be:

STEP 11/16: RUN --mount=type=cache,id=xGhFpvQL5qw-/root/bun,target=/root/.bun bun i --no-save
bun install v1.1.43 (76800b04)
2 |   "lockfileVersion": 1,
                         ^
error: Unknown lockfile version
    at bun.lock:2:22
InvalidLockfileVersion: failed to parse lockfile: 'bun.lock'

Locally, when working with the project, I use Bun v1.2+ which is the version the lockfile v1 has been introduced (lockfile version was 0 before that).

When I try to rebuild project with the latest version of nixpacks it works fine.

Steps to Reproduce

  1. Install the latest version of Bun (v1.2.x)
  2. Init a simple project such as it creates a bun.lock file with lockVersion 1
  3. Try to deploy that project using the latest version of Coolify (using v4.0.0-beta.420.5 in my case)
  4. Observe that it fails to deploy during the dependencies installation phase (the underlying reason being that the Bun version is too old in the nixpack used and therefore do not recognize the lockfile version)

Another way of seeing the issue, if you have nix installed on your computer, you can follow steps 1 and 2, then run the following to open a nix shell with nixpacks 1.34.0 (ref):

nix shell github:nixos/nixpkgs/c5dd43934613ae0f8ff37c59f61c507c2e8f980d#nixpacks

You can then build the project: nixpacks build /path/to/bun/project

Example Repository URL

No response

Coolify Version

v4.0.0-beta.420.5

Are you using Coolify Cloud?

No (self-hosted)

Operating System and Version (self-hosted)

Ubuntu 22.04.5 LTS

Additional Information

I didn't pin-point all versions updates in the different components involved here (Bun, nixpacks, nixpackages, Coolify) but it appears to me that fixing it should technically be as simple as updating the version of Nixpacks that Coolify is using (i don't however the kind of side-impact it could have)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions