Skip to main content
JG is here with you โœจ

Debug Diaries

Real debugging sessions from production. Symptoms, root causes, and actual solutions that worked.

No fluff, no theory โ€” just the messy reality of fixing things that break in production.

โš›๏ธ

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)

ViteReactBundlingProduction Bug
๐Ÿ”

Google OAuth: The PKCE Puzzle

โŒ OAuth flow working locally but failing in production with 400 errors

๐Ÿ” Symptoms

  • โ–ธLogin button triggers Google popup
  • โ–ธUser approves consent screen
  • โ–ธRedirect fails with 400 Bad Request
  • โ–ธNo error logs in Supabase dashboard

๐ŸŽฏ Root Cause

PKCE (Proof Key for Code Exchange) not enabled in Supabase client configuration. OAuth callback URL mismatch between Google Console (used Supabase URL) and actual redirect (app URL).

โœ… Solution

Enabled PKCE in supabase client initialization, added proper redirect URLs in both Google Console and Supabase dashboard, implemented proper environment variable validation with runtime checker.

โœ… Seamless OAuth flow, secure PKCE implementation, proper credential management

OAuthSupabaseSecurityAuthentication
๐Ÿ–ผ๏ธ

Avatar Upload: The Silent Failure

โŒ Upload spinner never stops, no error messages shown to user

๐Ÿ” Symptoms

  • โ–ธFile selector works fine
  • โ–ธUpload progress indicator appears
  • โ–ธSpinner runs indefinitely
  • โ–ธNo error in UI, but console shows 'Bucket not found'

๐ŸŽฏ Root Cause

Storage bucket 'avatars' never created in Supabase. Migration file existed but SQL was never executed in production database.

โœ… Solution

Ran avatar bucket migration manually in Supabase SQL editor. Added file size limit (5MB) and MIME type restrictions. Implemented proper RLS policies for authenticated users.

โœ… Uploads complete in <2s, proper error handling, user feedback on success/failure

SupabaseStorageUXError Handling
๐Ÿ“ฑ

Mobile Touch Conflicts: Pointer vs Touch

โŒ Hamburger menu and background switcher not responding on mobile devices

๐Ÿ” Symptoms

  • โ–ธDesktop navigation works perfectly
  • โ–ธMobile taps on UI buttons do nothing
  • โ–ธBackground canvas responds but UI doesn't
  • โ–ธTouch events seem to be intercepted

๐ŸŽฏ Root Cause

Canvas background animation had global pointer/touch listeners that were capturing ALL touch events before they reached UI elements. Event listeners weren't scoped to canvas element.

โœ… Solution

Scoped pointer/touch listeners to canvas bounds only. Added touch-action: none to canvas CSS. Implemented proper event.target checking to ensure canvas-only interaction.

โœ… Mobile UI fully responsive, background still interactive, no event conflicts

MobileTouch EventsCanvasUX

More debugging stories coming soon

Subscribe to the blog or check back for new episodes

Back to Lab Hub
Open to AI-Focused Roles

AI Sales โ€ข AI Strategy โ€ข AI Success โ€ข Creative Tech โ€ข Toronto / Remote

Let's connect โ†’
Terms of ServiceLicense AgreementPrivacy Policy
Copyright ยฉ 2026 JMFG. All rights reserved.