npm run build is failing on github actions

I am encountering an issue with the npm run build command in github actions.

> build
> tsc && vite build && vite build --ssr

vite v4.5.1 building for production...
transforming...
Unable to resolve `@import "../../../../vendor/filament/filament/resources/css/theme.css"` from /home/runner/work/pinnacle/pinnacle/resources/css/filament/hq
✓ 4 modules transformed.
✓ built in 1.34s
[vite:css] [postcss] ENOENT: no such file or directory, open '../../../../vendor/filament/filament/resources/css/theme.css'
file: /home/runner/work/pinnacle/pinnacle/resources/css/filament/hq/theme.css:undefined:undefined
error during build:
Error: [postcss] ENOENT: no such file or directory, open '../../../../vendor/filament/filament/resources/css/theme.css'
Error: Process completed with exit code 1.

Below is my github action script

  npm-build:
    needs: build-and-test
    name: 'Build NPM Assets'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Install Node.js
        uses: actions/setup-node@v2
        with:
          node-version: '18.x'
      - name: Install dependencies
        run: npm install
      - name: Build Assets
        run: npm run build
      - name: Pull changes
        run: git pull
      - name: Commit changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          branch: 'staging'
          commit_message: >
            chore: build npm assets


and my package.json
 "scripts": {
        "dev": "vite",
        "build": "tsc && vite build && vite build --ssr",
        "lint": "eslint . --ext js,jsx,ts,tsx",
        "test": "vitest"
    },
Was this page helpful?