Skip to content

bun run --filter fails with error: ENOENT on Linux when using workspace glob patterns #26401

@andredifs

Description

@andredifs

What version of Bun is running?

1.3.6+d530ed993 (also tested with 1.3.3)

What platform is your computer?

Linux x86_64 (Ubuntu 24.04 on GitHub Actions)

Note: Works correctly on macOS (Darwin 24.x arm64)

What steps can reproduce the bug?

  1. Create a monorepo with multiple workspace glob patterns:
{
    "name": "bun-workspace-glob-bug",
    "private": true,
    "workspaces": [
        "packages/*",
        "dashboard",
        "functions/*"
    ]
}
  1. Create the workspace packages:

    • dashboard/package.json with a simple script
    • packages/pkg-a/package.json
    • functions/func-a/package.json
    • functions/func-b/package.json
  2. Run:

bun install
bun run --filter dashboard hello

Minimal reproduction repository: (I can create one if needed)

The issue occurs in our production monorepo with ~50 packages. When we changed from explicit workspace listings to glob patterns, the --filter command started failing on Linux CI while continuing to work on macOS.

What is the expected behavior?

The command should run the script in the matched workspace:

dashboard hello: Hello from dashboard
dashboard hello: Exited with code 0

What do you see instead?

On Linux (GitHub Actions):

error: ENOENT

That's the entire error message - no path information, no stack trace, no indication of what file or directory is missing. The command fails in ~4ms, suggesting bun fails during workspace/filter resolution before attempting to run the script.

Additional information

Key observations:

  • bun install completes successfully
  • The error only occurs when running --filter commands after install
  • Works perfectly on macOS with identical setup
  • Reverting to explicit workspace listings fixes the issue:
{
    "workspaces": [
        "packages/pkg-a",
        "dashboard", 
        "functions/func-a",
        "functions/func-b"
    ]
}

Possibly related: #24012 (ENOENT error reporting on Linux)

Request: Could the ENOENT error include more context (which file/directory is missing)? The current error message makes debugging very difficult.

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