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

GitHub Action bunx: command not found #4961

Closed
serhii-chernenko opened this issue Sep 11, 2023 · 2 comments
Closed

GitHub Action bunx: command not found #4961

serhii-chernenko opened this issue Sep 11, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@serhii-chernenko
Copy link

What version of Bun is running?

1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983

What platform is your computer?

ubuntu-latest

What steps can reproduce the bug?

I used your docs to build an app with Vite:
https://bun.sh/guides/ecosystem/vite

And I use the Vite docs to create a workflow for GitHub Actions:
https://vitejs.dev/guide/static-deploy.html#github-pages

The created package.json file contains the command build.
It replaced it from
vite build
to
bunx --bun vite build

I saw the output error after the job of GitHub Actions:
image

main.yml:

name: Build TS React App with Bun and Vite

on:
  push:
    branches:
      - main

permissions:
  contents: read
  pages: write
  id-token: write

concurrency:
  group: 'pages'
  cancel-in-progress: true

jobs:
  build:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: oven-sh/setup-bun@v1
      - run: bun install
      - run: bun run build
      - uses: actions/configure-pages@v3
      - uses: actions/upload-pages-artifact@v1
        with: 
          path: './dist'
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v1

package.json:

{
  "name": "bun",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "bunx --bun vite",
    "build": "tsc && bunx --bun vite build",
    "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
    "preview": "vite preview"
  },
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  },
  "devDependencies": {
    "@types/react": "^18.2.15",
    "@types/react-dom": "^18.2.7",
    "@typescript-eslint/eslint-plugin": "^6.0.0",
    "@typescript-eslint/parser": "^6.0.0",
    "@vitejs/plugin-react-swc": "^3.3.2",
    "eslint": "^8.45.0",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-react-refresh": "^0.4.3",
    "typescript": "^5.0.2",
    "vite": "^4.4.5"
  }
}

What is the expected behavior?

bunx command has to be available for GitHub actions as well as on my local machine

What do you see instead?

I see failed job

Additional information

No response

@serhii-chernenko serhii-chernenko added the bug Something isn't working label Sep 11, 2023
@Electroid
Copy link
Contributor

As a temporary workaround, you can use bun x, but yes we'll fix this.

@Electroid
Copy link
Contributor

This has now been fixed, oven-sh/setup-bun#18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants