Skip to content

Fix GitHub Actions build error by using main-github-pages.tsx and updating dependencies#7

Merged
Rob Bos (rajbos) merged 3 commits into
mainfrom
copilot/fix-6
Jun 17, 2025
Merged

Fix GitHub Actions build error by using main-github-pages.tsx and updating dependencies#7
Rob Bos (rajbos) merged 3 commits into
mainfrom
copilot/fix-6

Conversation

Copilot AI commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

The GitHub Actions deployment workflow was failing with a Rollup resolution error:

[vite]: Rollup failed to resolve import "@github/spark/spark" from "/home/runner/work/github-copilot-usage/github-copilot-usage/src/main.tsx".

Root Cause

The workflow was attempting to externalize the @github/spark/spark dependency in the Vite config, but src/main.tsx still imported this dependency. This created a conflict where Rollup couldn't resolve the externalized import during the build process.

Solution

The repository already contained a src/main-github-pages.tsx file specifically designed for GitHub Pages deployment without Spark dependencies. The fix involves:

  1. Use GitHub Pages entry point: Copy src/main-github-pages.tsx to src/main.tsx during the build process to avoid Spark imports
  2. Fix repository base path: Correct the base path from /spark-template/ to /github-copilot-usage/
  3. Add missing Tailwind plugin: Include @tailwindcss/vite plugin in the Vite config
  4. Complete dependency list: Update the simplified package.json to include all Radix UI components and other dependencies used by the application

Changes Made

  • Added build step to use main-github-pages.tsx instead of main.tsx
  • Updated Vite config to include Tailwind CSS plugin and correct base path
  • Expanded dependency list in simplified package.json to include all required packages
  • Removed external dependency configuration since we're now using the clean entry point

Verification

Tested locally by simulating the GitHub Actions build process - the build now completes successfully and generates proper assets for GitHub Pages deployment.

Fixes #6.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ating dependencies

Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build error in GitHub Actions Fix GitHub Actions build error by using main-github-pages.tsx and updating dependencies Jun 17, 2025
Copilot AI requested a review from Rob Bos (rajbos) June 17, 2025 16:11
@rajbos Rob Bos (rajbos) marked this pull request as ready for review June 17, 2025 16:50
@rajbos Rob Bos (rajbos) merged commit 49ccf57 into main Jun 17, 2025
2 checks passed
@rajbos Rob Bos (rajbos) deleted the copilot/fix-6 branch June 17, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix build error in GitHub Actions

2 participants