nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.65k stars 2.36k forks source link

Unable to run nx-cloud with bun because lockfile is not found #27717

Open cortopy opened 2 months ago

cortopy commented 2 months ago

Current Behavior

I just setup a new Nx monorepo with bun using bunx create-nx-workspace@latest --preset=@nxtensions/astro --packageManager bun

This github action file was generated:

name: CI

on:
  push:
    branches:
      - main
  pull_request:

permissions:
  actions: read
  contents: read

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - uses: oven-sh/setup-bun@v1
        with:
          bun-version: latest

      # This enables task distribution via Nx Cloud
      # Run this command as early as possible, before dependencies are installed
      # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
      - run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"

      - run: bun install --no-cache
      - uses: nrwl/nx-set-shas@v4

      # Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
      # - run: bun nx-cloud record -- echo Hello World
      # Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
      - run: bun nx affected -t lint test build

The problem is that when the action runs, it always fails because lockfile can't be found

image

If I remove the line to setup nx-cloud it works.

I searched and it seems a similar issue was created for cases when nx is not at the root of the monorepo, which isn't my case.

Expected Behavior

Cloud runs work

GitHub Repo

No response

Steps to Reproduce

  1. Run bunx create-nx-workspace@latest --preset=@nxtensions/astro --packageManager bun
  2. Push to github

Nx Report

Node           : 20.12.0
OS             : linux-x64
Native Target  : x86_64-linux
bun            : 1.1.26

nx (global)    : 19.6.4
nx             : 19.6.4
@nx/js         : 19.6.4
@nx/workspace  : 19.6.4
@nx/devkit     : 19.6.4
@nrwl/tao      : 19.6.4
@nx/vite       : 19.6.4
@nx/web        : 19.6.4
typescript     : 5.5.4
---------------------------------------
Registered Plugins:
@nxtensions/astro
@nx/vite/plugin
---------------------------------------
Community plugins:
@gitopslovers/nx-biome : 1.5.0
@nxtensions/astro      : 19.0.1

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

No response

mimse commented 2 months ago

I have the same issues with bunx create-nx-workspace@latest --preset=@analogjs/platform

arvilmena commented 3 weeks ago

I am getting the same issue since we are using Bun in our monorepo, will I be in trouble if I temporarily disable the action step:

- run: bunx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"

until we get the fix? or drop Bun for now? @jaysoo @MaxKless