[PR #6687] [CLOSED] Reload once when a lazy chunk fails to load after an upgrade #6412

Closed
opened 2026-11-02 04:08:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6687
Author: @freeb5d
Created: 9/29/2026
Status: ❌ Closed

Base: main ← Head: fix/reload-on-stale-chunk


📝 Commits (2)

  • 6f0d888 Reload once when a lazy chunk fails to load after an upgrade
  • d13ddb6 fix(frontend): allow a stale-chunk reload again after a quiet period

📊 Changes

3 files changed (+67 additions, -0 deletions)

View changed files

➕ frontend/src/lib/chunk-reload.ts (+17 -0)
📝 frontend/src/main.tsx (+13 -0)
➕ frontend/src/test/chunk-reload.test.ts (+37 -0)

📄 Description

Refs #6673

Problem

A panel tab left open across an upgrade requests hashed chunk files (e.g. XrayPage-*.js) that the new build no longer serves, so the user sees "Failed to fetch dynamically imported module" / the router error page until they hard-refresh. As noted on the issue there is no vite:preloadError handling.

Change

frontend/src/main.tsx listens for vite:preloadError and reloads the page once (guarded by a sessionStorage flag so a genuinely missing file cannot cause a reload loop).

Testing

Not run: no frontend build or browser check in my environment. Please rely on CI.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6687 **Author:** [@freeb5d](https://github.com/freeb5d) **Created:** 9/29/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/reload-on-stale-chunk` --- ### 📝 Commits (2) - [`6f0d888`](https://github.com/MHSanaei/3x-ui/commit/6f0d8882aa2a05d17f9412ed33cfac8b426ae2bc) Reload once when a lazy chunk fails to load after an upgrade - [`d13ddb6`](https://github.com/MHSanaei/3x-ui/commit/d13ddb614685b1d388658e7a1d0922c6d2d5bbc6) fix(frontend): allow a stale-chunk reload again after a quiet period ### 📊 Changes **3 files changed** (+67 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `frontend/src/lib/chunk-reload.ts` (+17 -0) 📝 `frontend/src/main.tsx` (+13 -0) ➕ `frontend/src/test/chunk-reload.test.ts` (+37 -0) </details> ### 📄 Description Refs #6673 ## Problem A panel tab left open across an upgrade requests hashed chunk files (e.g. `XrayPage-*.js`) that the new build no longer serves, so the user sees "Failed to fetch dynamically imported module" / the router error page until they hard-refresh. As noted on the issue there is no `vite:preloadError` handling. ## Change `frontend/src/main.tsx` listens for `vite:preloadError` and reloads the page once (guarded by a `sessionStorage` flag so a genuinely missing file cannot cause a reload loop). ## Testing Not run: no frontend build or browser check in my environment. Please rely on CI. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:08:35 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#6412
No description provided.