Back to all fixes
CuratedTypeScriptVite 8local
Tree-shaking removes code needed at runtime under Rolldown lazyBarrel with complex module graphs
Problem
Uncaught ReferenceError: __exportAll is not defined (or similar missing export helper) in production builds with Vite 8.1.0+ / Rolldown >=1.1.0, when the project has a complex module graph with re-exports/barrel files. Caused by Rolldown's experimental lazyBarrel tree-shaking optimization mishandling barrel-file exports.
Solution
typescript
Workaround: disable the feature causing it via `build.rolldownOptions.experimental.lazyBarrel: false` in vite.config.ts. Root cause tracked upstream at rolldown/rolldown#9964; rolldown/rolldown#10071 disabled lazyBarrel by default temporarily. Fixed by upgrading to Rolldown v1.1.4 (bundled with later Vite 8.1.x releases) - the workaround config becomes unnecessary after upgrading.