Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 7, 2025

import.meta.env.VITE_GIT_SHA was undefined in production builds, causing the footer to display "undefined" as link text pointing to /commit/undefined.

Changes

  • vite.config.ts: Inject git SHA at build time via define option

    • Primary: git rev-parse --short HEAD
    • Fallback: VITE_GIT_SHA or COMMIT_REF env vars (Netlify)
    • Returns undefined if unavailable
  • Footer.tsx: Conditionally render commit link only when SHA is defined

  • package.json: Remove redundant VITE_GIT_SHA from scripts (now handled by Vite)

Before

undefined link in footer

After

commit SHA properly displayed

Original prompt

This section details on the original issue you should resolve

<issue_title>Footer shows “undefined” link and incorrect GitHub commit URL</issue_title>
<issue_description>The footer displays a link with the text undefined, and the generated URL points to /commit/undefined. This happens because import.meta.env.VITE_GIT_SHA is not defined during the build.

Image</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: coder13 <881394+coder13@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix undefined link in footer and incorrect GitHub commit URL Fix footer git SHA injection for Netlify builds Dec 8, 2025
Copilot AI requested a review from coder13 December 8, 2025 00:08
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.

Footer shows “undefined” link and incorrect GitHub commit URL

2 participants