React Bundling Corruption: The Terser Trap
❌ Cannot read properties of undefined (reading 'ReactCurrentDispatcher')
🔍 Symptoms
- ▸React errors in production console
- ▸App working locally but broken on Netlify
- ▸ReactCurrentBatchConfig undefined errors
🎯 Root Cause
Overly aggressive Terser minification with 3 compression passes was corrupting React's internal structure. Combined with disabled code splitting, React and ReactDOM were being minified together into one bundle.
✅ Solution
Reduced Terser to single pass, removed pure_getters and side_effects flags, enabled proper code splitting with separate vendor chunks for React, ReactDOM, and other libraries.
✅ Clean 200 OK status, no console errors, proper chunk separation (React: 50KB, ReactDOM: 265KB)