json-schema-org / json-schema-org/website

🐛 Bug: Homepage crashes when calendar fetch fails

Open
#2,368 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐛 Bug Status: Triage
Dominant language
HTML
Stars
169
Forks
484
Avg merge
2d 2h
Merged PRs (30d)
6

Description

Describe the bug

The homepage crashes when the external Google Calendar fetch fails.

When the calendar request fails (e.g., due to network/DNS issues), the datesInfo value becomes undefined. This causes:

  • A serialization error in getStaticProps
  • A runtime error when the UI attempts to call .map() on null/undefined

This results in the homepage failing to load.

Steps To Reproduce
  1. Clone and run the project locally
  2. Run yarn dev
  3. Simulate failure of the external calendar API (e.g., disconnect internet or block access to calendar.google.com)
  4. This issue occurs when the external calendar API is unavailable (e.g., DNS failure, firewall blocking, or network issues).
  5. Open http://localhost:3000
  6. Observe that the homepage crashes
Expected Behavior

The website should load successfully even if the calendar fetch fails.

The application should gracefully handle the failure and fallback to a safe value (e.g., null or empty list) instead of crashing.

Screenshots

Homepage error showing "Error serializing .datesInfo" and map crash

Image
Device Information [optional]
- OS:
- Browser:
- version:
Are you working on this issue?

Yes

Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)

No

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the homepage's getStaticProps and trace how the external Google Calendar response becomes datesInfo, then reproduce the failure with yarn dev while blocking calendar.google.com. Confirm that the homepage loads when the fetch fails, serialization succeeds, and the UI does not call map on an undefined value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, next.js
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.