You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rx.icon static icons emit a lucide-react barrel import, flooding the dev server with ~1700 requests #6627
rx.icon with a static string tag (e.g. rx.icon("wifi_off")) compiles to a barrel import from lucide-react:
import{WifiOff}from"lucide-react"
On its own this is fine — Vite tree-shakes it in prod and bundles it into one file in dev. But the moment the app's module graph also contains lucide-react/dynamic.mjs (which rx.icon uses for dynamic / state-Var tags via DynamicIcon), Vite's esbuild dep-optimizer is forced to emit a separate chunk per icon for the dynamic-import map, and esbuild then rewrites the barrel to statically import every one of those ~1500 per-icon chunks.
Because DefaultOverlayComponents (the connection banner, mounted on every page) itself does a barrel import { WifiOff } from "lucide-react", any app that also renders a dynamic icon makes loading any page in dev fire ~1700 network requests — the entire icon library.
Open the page in the browser, watch the Network tab.
Observe ~1700 requests, one per icon in lucide-react, instead of the handful actually used.
Note: even an app with only static icons hits this, because the default connection overlay pulls in lucide-react/dynamic.mjs indirectly through rx.icon's shared module.
Expected
Loading a page should only fetch the icons actually used (a handful), not the whole library.
Root cause
The static-string icon codegen emits a named barrel import from lucide-react. Combined with the per-icon dynamic-import map, esbuild expands the barrel into a static import of every icon chunk.
Fix
Emit deep per-icon default imports (lucide's officially recommended form) for the static path, leaving the dynamic (Var → DynamicIcon) path untouched:
Activity
linear-code commentedon Jun 8, 2026
ENG-9722
chore: add changelog fragment for #6627
fix: emit deep per-icon imports for static lucide icons (#6628)