Skip to content

A page from before a deploy reloads for a missing chunk instead of going black - #90

Merged
andrin-n-dream merged 1 commit into
masterfrom
files
Oct 1, 2026
Merged

andrin-n-dream merged 1 commit into
masterfrom
files

Conversation

@andrin-n-dream

Copy link
Copy Markdown
Contributor

Opening a Markdown file sometimes blacked out the whole screen. The
Markdown renderer is a lazy chunk, and every deploy rebuilds web/dist
under new chunk names; a page left open across one asks for the old
name the first time it needs that chunk. The server answered the
missing file with index.html and a 200, the browser refused HTML as a
module, the lazy import threw, and with no error boundary anywhere
React unmounted the whole app. Reproduced on a scratch instance by
answering the chunk that way: #root was left with no children.

Three layers, outermost last:

  • lazyChunk wraps React.lazy for both lazy panes (the editor and the
    Markdown renderer): a chunk that fails to load reloads the page once
    per 30s window, 600ms later so the click's debounced ui write lands
    first -- without that the reload came back with the panel open and no
    file in it. A second failure inside the window is real and throws.
  • An ErrorBoundary around the files panel's content, keyed by mode and
    path, says 'This could not be shown' with a Reload button and costs
    that pane alone; one around the app says so instead of going black.
  • The server answers a missing /assets/ file 404 rather than
    index.html, so the failure says the file is gone.

Measured: with the chunk gone once, the page reloaded once and showed
the file, 3 out of 3; gone for good, it reloaded once and then the pane
said why with all 7 windows intact. The tests fail with the reload
removed and with the window removed.

🤖 Generated with Claude Code

…ing black

Opening a Markdown file sometimes blacked out the whole screen. The
Markdown renderer is a lazy chunk, and every deploy rebuilds web/dist
under new chunk names; a page left open across one asks for the old
name the first time it needs that chunk. The server answered the
missing file with index.html and a 200, the browser refused HTML as a
module, the lazy import threw, and with no error boundary anywhere
React unmounted the whole app. Reproduced on a scratch instance by
answering the chunk that way: #root was left with no children.

Three layers, outermost last:

- lazyChunk wraps React.lazy for both lazy panes (the editor and the
  Markdown renderer): a chunk that fails to load reloads the page once
  per 30s window, 600ms later so the click's debounced ui write lands
  first -- without that the reload came back with the panel open and no
  file in it. A second failure inside the window is real and throws.
- An ErrorBoundary around the files panel's content, keyed by mode and
  path, says 'This could not be shown' with a Reload button and costs
  that pane alone; one around the app says so instead of going black.
- The server answers a missing /assets/ file 404 rather than
  index.html, so the failure says the file is gone.

Measured: with the chunk gone once, the page reloaded once and showed
the file, 3 out of 3; gone for good, it reloaded once and then the pane
said why with all 7 windows intact. The tests fail with the reload
removed and with the window removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@andrin-n-dream
andrin-n-dream merged commit d514fbd into master Oct 1, 2026
1 check passed
@andrin-n-dream
andrin-n-dream deleted the files branch October 1, 2026 16:51
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