fix: pre-declare buffer shim to avoid Vite cold-start optimizer race #4
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-vite-optimizer-cold-start-race"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
vite-plugin-node-polyfills/shims/buffertooptimizeDeps.includeinvite.config.tsso it's known during Vite's initial dependency scan instead of being discovered mid-session.rename-to-tesserowchange: on a freshnode_modules/.vitecache, the late-discovered Buffer shim (needed by pdfkit's standalone browser bundle) forced a mid-session re-optimize that raced in-flight chunk requests (e.g. the shared@mui/icons-materialcreateSvgIconchunk), producing a transient 404 and a full page reload.optimizeDepsdoesn't affect production builds.openspec/changes/archive/2026-09-18-fix-vite-optimizer-cold-start-race/.Test plan
node_modules/.vitecache before the fixnpm run vite:devruns post-fix show zero race indicatorsnpm start(Tauri dev) launches cleanly with no panics; icon-serving modules load with no optimizer errorsnpm run package(production build) still succeeds, unaffected by the dev-only config change🤖 Generated with Claude Code