Skip to content

🐞[Bug]: DOCUSAURUS_GIT_TOKEN missing in .env causes Leaderboard not to load on localhost #825

@sheikhlimon

Description

@sheikhlimon

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Description

The contributors section is not displaying, and Docusaurus shows the following error:

Error: GitHub token not found. Please set customFields.gitToken in docusaurus.config.js
No contributors found.

The issue occurs even after running cp .env.example .env and adding GITHUB_TOKEN to .env.

Root Cause

  • Docusaurus expects the GitHub token to be available under DOCUSAURUS_GIT_TOKEN in .env.
  • Using GITHUB_TOKEN will not work because the customFields.gitToken in docusaurus.config.js specifically reads process.env.DOCUSAURUS_GIT_TOKEN.
  • The .env.example file is not the issue, as it only provides a template and is not loaded automatically by Docusaurus.

Steps to Reproduce

  1. Clone the repository.
  2. Copy .env.example to .env and add GITHUB_TOKEN (not DOCUSAURUS_GIT_TOKEN).
  3. Start Docusaurus dev server: npm run start or yarn start.

Expected behavior

  • Contributors should load correctly from GitHub.
  • No errors should appear regarding missing tokens.

Add ScreenShots

No response

What browsers are you seeing the problem on?

No response

Record

  • I have read the Contributing Guidelines
  • Are you a GSSOC'25 contributor
  • I want to work on this issue

Metadata

Metadata

Assignees

Type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions