unionlabs / union

The trust-minimized, zero-knowledge bridging protocol, designed for censorship resistance, extremely high security, and usage in decentralized finance.
https://union.build
Apache License 2.0
382 stars 33 forks source link

Site Breaks in Development Mode Without Contentful API Credentials #3336

Open rickybharti opened 11 hours ago

rickybharti commented 11 hours ago

Describe the bug The site does not function when Contentful APIs and links are not configured. Developers without access to the required Contentful credentials (e.g., PUBLIC_CONTENTFUL_SPACE_ID, PUBLIC_CONTENTFUL_ACCESS_TOKEN) are unable to work on the site, as it leads to errors like Cannot read properties of undefined (reading 'content') and Cannot read properties of undefined (reading 'fields'). This prevented me from testing or contributing.

To Reproduce Steps to reproduce the behavior:

  1. Clone the repository to a local environment.
  2. Attempt to run the site without configuring Contentful API keys or environment variables.
  3. Open the site in a browser after starting the development server.
  4. Observe errors like Cannot read properties of undefined (reading 'content') in the terminal or browser console.

Expected behavior The site should:

  1. Provide mock data or a fallback mechanism during development when Contentful APIs are not configured.
  2. Allow developers to work on and test other parts of the site without requiring access to Contentful credentials.

Screenshot Screenshot 2024-12-04 at 1 06 12 PM

Device: • Hardware: MacBook Air (M1) • OS: macOS Ventura 13.x • Browser: Chrome 119.x

Additional context Introducing mock data or a fallback mechanism during development mode would make the project more developer-friendly and easier to contribute to, I tried making my own mock data, but the site uses it extensively across pages from team, ecosystem & even the landing page, thus it'd require hours of work trying to replicate it, while i wanted to focus more on improving the actual issues or improvements in the code.

Let me know if you need more details on the errors I faced, or more context about the issue I'm facing. (tagging @Swepool @o-az assuming you both maintain the site ❤️)

rickybharti commented 11 hours ago

Also, I didn't pick the labels here. They were automatically added @o-az 😭