Skip to content

Fix/loading error#121

Open
JonnieSparkles wants to merge 4 commits into
mainfrom
fix/loading-error
Open

Fix/loading error#121
JonnieSparkles wants to merge 4 commits into
mainfrom
fix/loading-error

Conversation

@JonnieSparkles

Copy link
Copy Markdown
Collaborator

Fixes:

The issue is a transient gateway failure while the docs app is loading Next.js client chunks. The initial HTML loads, but a request like /_next/static/chunks/*.js can return 502 Bad Gateway. Next then throws a ChunkLoadError, which becomes a fatal client-side exception and leaves users on the generic “Application error” page.
The fix adds two layers of recovery:

  1. An early client script now listens for failed Next chunk loads, ChunkLoadError, 502, and Bad Gateway signals. If one occurs, it automatically reloads the page, capped at 2 retries within 30 seconds to avoid reload loops.
  2. A root global-error.tsx fallback now handles cases that still reach React’s error boundary. It attempts the same bounded reload for chunk errors and shows a branded recovery screen with “Reload docs” and “Try again” buttons instead of the generic crash page.

- Updated TypeScript configuration to preserve JSX.
- Added GlobalError component for handling loading errors in the documentation.
- Introduced ChunkLoadRecoveryScript to manage chunk load failures and automatic reloads.
- Integrated ChunkLoadRecoveryScript into the main layout for improved error resilience.
- Introduced fallback state management using window.name for chunk load errors.
- Updated read and write functions to handle state persistence across sessions.
- Improved error messaging in the GlobalError component for better user guidance.
- Refactored chunk load recovery script to utilize the new state management logic.
@JonnieSparkles JonnieSparkles requested a review from a team as a code owner June 26, 2026 13:59
…olana upload keys

- Added instructions for setting `OBSERVER_PRIVATE_KEY` and `SOLANA_UPLOAD_PRIVATE_KEY` in the quick-start guide.
- Clarified the use of keypair files versus inline base58 keys for observer wallets.
- Enhanced environment variable documentation to recommend explicit upload key settings for improved reliability.
- Included notes on configuring `TurboReportSink` to ensure proper report uploads.
@github-actions

Copy link
Copy Markdown

Permaweb Preview Deployed

Your preview is available at: https://docs-pr-121_docs.ar.io

Property Value
Transaction ID 32mz8tdSy7mJ0otY7NP3uIm_tZOWHkB6c96p66HbTsM
ArNS Name docs
Undername docs-pr-121

This preview will be available permanently on Arweave via the AR.IO Network.

- Introduced a new workflow for deploying to GitHub Pages, allowing manual triggers and setting up the necessary build environment.
- Updated the PR preview workflow to use manual triggers instead of automatic ones, simplifying the deployment process.
- Added a basePath configuration option in the Next.js config for better handling of deployment paths.
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.

1 participant