Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On GitHub Actions Windows (Server 2022, 2025), bun run --bun still launches Node #16907

Open
yaroslav opened this issue Jan 30, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@yaroslav
Copy link

What version of Bun is running?

1.2.1

What platform is your computer?

Windows Server 2022, Windows Server 2025, GitHub Actions

What steps can reproduce the bug?

I am building something where I rely on integration tests to see if the environment uses a version of Bun and not Node.

Related: #11869

To test if I'm running Bun, in my integration test I build a sample application, where during the build I use a simple Bun.version call to see if the build is actually executed by Bun.

The setup is simple:

package.json

{
  "name": "app",
  "private": "true",
  "dependencies": {
    "autoprefixer": "^10.4.20",
    "postcss": "^8.5.1",
    "postcss-cli": "^11.0.0",
    "postcss-import": "^16.1.0",
    "postcss-nesting": "^13.0.1"
  },
  "scripts": {
    "build:css": "postcss ./app/assets/stylesheets/application.postcss.css -o ./app/assets/builds/application.css",
    "build": "bun bun.config.js"
  }
}

and then

bun run --bun build:css

To test things, I have a simple PostCSS plugin

          module.exports = () => ({
            postcssPlugin: 'bun-check',
            Once(root) {
              root.append({ text: `/* Built with Bun ${Bun.version} */` })
            }
          })
          module.exports.postcss = true

It fails on GHA Windows with

$ postcss ./app/assets/stylesheets/application.postcss.css -o ./app/assets/builds/application.css
ReferenceError: Bun is not defined

Currently, my setup works on Linux, macOS, my local copy of Windows 11, but it fails on GitHub Actions running Windows (I've tried 2022 and 2025 Server).

What works: bun x --bun
What fails on GHA Windows, but works elsewhere: bun run --bun

What is the expected behavior?

Expected: the --bun flag runs the Bun runtime without falling back to Node even if it is available.

What do you see instead?

Instead, it tries to launch Node and dies on my check (Bun is not defined).

Additional information

No response

@yaroslav yaroslav added bug Something isn't working needs triage labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant