Debugging Guide - Interactive Elements Not Working
If toggles, tabs, and buttons aren’t working, follow these steps:
Step 1: Check Browser Console
-
Open Developer Tools: - Press
F12orCmd+Option+I(Mac) /Ctrl+Shift+I(Windows/Linux) - Or right-click → “Inspect” → “Console” tab -
Look for errors: - Red error messages indicate JavaScript failures - Common issues:
Cannot read property 'X' of undefineduseParamsStore is not a functionReact is not definedlocalStorage is not available
-
Take a screenshot of any errors and share them
Step 2: Clear Browser Cache & localStorage
-
Clear localStorage: - In DevTools, go to “Application” tab (Chrome) or “Storage” tab (Firefox) - Find “Local Storage” →
http://localhost:3000- Delete thewhealthy-paramskey - Refresh the page -
Hard refresh: -
Ctrl+Shift+R(Windows/Linux) orCmd+Shift+R(Mac) - This clears cached JavaScript
Step 3: Check Network Tab
- In DevTools, go to “Network” tab
- Refresh the page
- Look for failed requests (red entries)
- Check if
_next/static/chunks/files are loading
Step 4: Verify React is Working
Open the browser console and type:
window.React
If it returns undefined, React isn’t loading properly.
Step 5: Test Basic Interactivity
In the browser console, try:
// Test if event listeners work
document.addEventListener('click', () => console.log('Click detected'));
// Then click anywhere on the page - you should see "Click detected"
Common Issues & Fixes
Issue: “Cannot read property of undefined”
Fix: The Zustand store might not be initialized. Clear localStorage and refresh.
Issue: Tabs render but don’t switch
Fix: Radix UI might not be loading. Check if @radix-ui/react-tabs is in node_modules.
Issue: Everything is grayed out / unclickable
Fix: Check for CSS pointer-events: none or z-index issues. In DevTools, inspect an element and check computed styles.
Issue: “Hydration mismatch” errors
Fix: This is a Next.js SSR issue. The app should still work, but try clearing cache.
Quick Test
Run this in the browser console to test if the store is working:
// This should return the current params
localStorage.getItem('whealthy-params')
If it returns null, the store hasn’t initialized yet. Wait a moment and try again.
Still Not Working?
-
Check the terminal where
npm run devis running - Look for compilation errors - Look for runtime errors -
Try a different browser: - Chrome/Edge - Firefox - Safari
-
Check Node.js version:
bash node -vShould be ≥20.9.0 -
Reinstall dependencies:
bash rm -rf node_modules package-lock.json npm install npm run dev