Jordan-Hall / nx-bun

https://jordan-hall.github.io/nx-bun/
Other
58 stars 6 forks source link

bun | task worker runner | nx bun: executor @bun-nx/nx:build (and nx target) hang forever after bun successful build #21

Open BattlefieldNoob opened 6 months ago

BattlefieldNoob commented 6 months ago

Describe the bug When using @bun-nx/nx:build executor, the build executes correctily, but the nx target run forever and never exit I'm using a mixed environment (node/bun)

To Reproduce Just execute nx build example-app from this repo (after nx build nx-bun of course) (i didn't tried from a bun-only environment, because the mixed enviromnent is essential for my project) My build target config:

{
    "build": {
      "executor": "@nx-bun/nx:build",
      "outputs": [
        "{options.outputPath}"
      ],
      "defaultConfiguration": "production",
      "options": {
        "entrypoints": ["apps/flower-care-rpi/src/main.ts"],
        "outputPath": "dist/apps/flower-care-rpi",
        "tsConfig": "apps/flower-care-rpi/tsconfig.app.json",
        "smol": false,
        "minify": true,
        "bun": true,
        "assets": [
          "apps/flower-care-rpi/src/assets"
        ]
      }
    }
}

My tsconfig.app.json:

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "../../dist/out-tsc",
    "module": "commonjs",
    "types": ["node"]
  },
  "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"],
  "include": ["src/**/*.ts"]
}

My tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    "rootDir": ".",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "module": "esnext",
    "lib": [
      "es2020",
      "dom"
    ],
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "baseUrl": ".",
    "paths": {},
    "types": [
      "bun-types"
    ]
  },
  "exclude": [
    "node_modules",
    "tmp"
  ]
}

Expected behavior The nx target should terminate (with success), so any subsequent targets can run

Additional context My Environment: Windows with DevContainer (created from "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye") Bun version: 1.0.15 (installed with curl -fsSL https://bun.sh/install | bash)

output of nx list:

 NX   Local workspace plugins:

   @nx-bun/nx (executors,generators)

 NX   Installed plugins:

   @angular-devkit/build-angular (executors)
   @angular/animations ()
   @angular/cli ()
   @angular/common ()
   @angular/compiler ()
   @angular/compiler-cli ()
   @angular/core (generators)
   @angular/forms ()
   @angular/language-service ()
   @angular/platform-browser ()
   @angular/platform-browser-dynamic ()
   @angular/router ()
   @gnuechtel/nx-cucumber (executors,generators)
   @nx-bun/nx (executors,generators)
   @nx-tools/nx-container (executors,generators)
   @nx/angular (executors,generators)
   @nx/devkit ()
   @nx/esbuild (executors,generators)
   @nx/eslint (executors,generators)
   @nx/eslint-plugin ()
   @nx/jest (executors,generators)
   @nx/js (executors,generators)
   @nx/netlify (generators)
   @nx/node (generators)
   @nx/playwright (executors,generators)
   @nx/storybook (executors,generators)
   @nx/web (executors,generators)
   @nx/workspace (executors,generators)
   @schematics/angular (generators)
   @storybook/angular (executors)
   nx (executors,generators)

 NX   Also available:

   @nx/cypress (executors,generators)
   @nx/detox (executors,generators)
   @nx/expo (executors,generators)
   @nx/express (generators)
   @nx/nest (generators)
   @nx/next (executors,generators)
   @nx/plugin (executors,generators)
   @nx/react (executors,generators)
   @nx/react-native (executors,generators)
   @nx/rollup (executors,generators)
   @nx/vite (executors,generators)
   @nx/webpack (executors,generators)
Jordan-Hall commented 6 months ago

Thank you. I will take a look into this later today

millsjoe commented 4 months ago

Hi @Jordan-Hall do you have an idea when this might be fixed? Still seeing it as an issue when running build 😢