fix(dashboard): reload on stale chunk after redeploy

Builds now emit version.json + a __BUILD_VERSION__ define. The client
re-checks the remote version on visibilitychange/focus and reloads on
mismatch, so a backgrounded tab doesn't hit a 404'd hashed chunk and
surface "'text/html' is not a valid JavaScript MIME type" when opening
Settings. ErrorBoundary catches stale-chunk errors as a safety net.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Fusion
2026-04-26 09:48:04 -07:00
committed by gsxdsm
parent a692edf079
commit ca26ae0781
6 changed files with 111 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
import { Component, type ReactNode, type ErrorInfo } from "react";
import { AlertTriangle } from "lucide-react";
import { handleChunkLoadError } from "../versionCheck";
import "./ErrorBoundary.css";
interface ErrorBoundaryProps {
@@ -26,6 +27,7 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
componentDidCatch(error: Error, errorInfo: ErrorInfo): void {
console.error("[ErrorBoundary]", error, errorInfo);
if (handleChunkLoadError(error)) return;
this.props.onError?.(error, errorInfo);
}