Skip to content

fix(remote-workspace): replace crashing Material icon lib with react-file-icon#181

Merged
haowei2000 merged 1 commit into
developfrom
fix/remote-workspace-file-icon
Jul 13, 2026
Merged

fix(remote-workspace): replace crashing Material icon lib with react-file-icon#181
haowei2000 merged 1 commit into
developfrom
fix/remote-workspace-file-icon

Conversation

@haowei2000

Copy link
Copy Markdown
Collaborator

Hotfix for a crash now live on main (#180). Clicking Remote Workspace threw immediately.

Root cause

react-material-icon-theme@1.2.0 bundles a React-19 JSX runtime that reads recentlyCreatedOwnerStacks off React's shared internals — which is undefined under this project's React 18 — so the file tree threw the instant it rendered. Reproduced in a plain renderToString:

TypeError: Cannot read properties of undefined (reading 'recentlyCreatedOwnerStacks')
  at react-material-icon-theme/dist/index.esm.js:253

The 304 on the icon chunk was a red herring — it loaded fine; the crash was at render. It's a library packaging bug (it should externalize react/jsx-runtime), not fixable on our side.

Fix

Swap to react-file-icon — already a project dependency (used for chat attachments), Seti palette, colored per-extension, React-18-safe (verified via renderToString across ts/rs/py/json/md/dockerignore). Folders keep the lucide glyph.

Bonus: removes the ~279 kB-gzip monolith and its lazy chunk entirely; react-file-icon is tiny, so no lazy boundary is needed. RemoteWorkspaceDialog chunk stays ~8.9 kB gzip.

Verification

  • tsc + build green; the MaterialFsIcon chunk is gone from the output.
  • react-file-icon render verified under React 18; it's already battle-tested in this app.
  • Note: the true Material Icon Theme look would need the extension's raw SVGs vendored in (React-18-safe) — happy to do that as a follow-up if the Seti icons aren't distinct enough.

🤖 Generated with Claude Code

…file-icon

react-material-icon-theme@1.2.0 bundles a React-19 JSX runtime that reads
`recentlyCreatedOwnerStacks` off React's internals — undefined under this
project's React 18 — so the Remote Workspace tree threw the moment it
rendered (repros in a plain renderToString). Its icon chunk loaded fine
(the 304 was a red herring); the crash was at render.

Swap it for react-file-icon, which the app already uses for chat
attachments (Seti palette, colored per-extension, React-18-safe). Folders
keep the lucide glyph. Bonus: drops the ~279 kB-gzip monolith and its lazy
chunk entirely — react-file-icon is tiny, so no lazy boundary is needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@haowei2000
haowei2000 merged commit ee81c39 into develop Jul 13, 2026
10 checks passed
haowei2000 added a commit that referenced this pull request Jul 13, 2026
Promote develop → main: fix Remote Workspace icon crash (#181)
@haowei2000
haowei2000 deleted the fix/remote-workspace-file-icon branch July 13, 2026 17:01
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