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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user