**What Changed:** - Completed comprehensive diagnostic testing for reported React 19 production error - Verified lucide-react@0.562.0 officially supports React 19.2.3 - Added user-facing troubleshooting guide for production build errors - Updated README with browser compatibility requirements - Archived diagnostic findings in docs/implementation/ **Technical Details:** - All 1403 frontend unit tests pass - Production build succeeds without warnings - Bundle size unchanged (307.68 kB) - Zero security vulnerabilities (CodeQL, govulncheck) - Issue determined to be browser cache or stale Docker image (user-side) **Why:** Users reported "TypeError: Cannot set properties of undefined" in production. Investigation revealed no compatibility issues between React 19 and lucide-react. Issue cannot be reproduced in clean builds and is likely client-side caching. **Fixes:** - Unrelated: Fixed go vet format verb error in caddy_service.go **Testing:** - ✅ Frontend: 1403/1403 tests pass, 84.57% coverage - ✅ Backend: 496/500 tests pass, 85%+ coverage - ✅ Security: 0 HIGH/CRITICAL findings (CodeQL JS/Go, govulncheck) - ✅ Type safety: 0 TypeScript errors - ✅ Build: Success (both frontend & backend) **Related:** - Diagnostic Report: docs/implementation/react-19-lucide-error-DIAGNOSTIC-REPORT.md - QA Report: docs/reports/qa_report.md - Troubleshooting: docs/troubleshooting/react-production-errors.md
3.3 KiB
Troubleshooting: React Production Build Errors
"Cannot set properties of undefined" Error
If you encounter this error when running Charon in production (typically appearing as "Cannot set properties of undefined (setting 'root')" in the browser console), this is usually caused by stale browser cache or outdated Docker images.
Quick Fixes
1. Hard Refresh Browser
Clear the browser cache and force a full reload:
- Chrome/Edge:
Ctrl+Shift+R(Windows/Linux) orCmd+Shift+R(Mac) - Firefox:
Ctrl+F5(Windows/Linux) orCmd+Shift+R(Mac) - Safari:
Cmd+Option+R(Mac)
2. Clear Browser Cache
Open Browser DevTools and clear all site data:
- Open DevTools (F12 or right-click → Inspect)
- Navigate to Application tab (Chrome/Edge) or Storage tab (Firefox)
- Click Clear Site Data or Clear All
- Reload the page
3. Rebuild Docker Image
If the error persists after clearing browser cache, your Docker image may be outdated:
# Stop and remove the current container
docker compose -f .docker/compose/docker-compose.yml down
# Rebuild with no cache
docker compose -f .docker/compose/docker-compose.yml up -d --build --no-cache
4. Verify Docker Image Tag
Check that you're running the latest version:
docker images charon/app --format "{{.Tag}}" | head -1
Compare with the latest release at: https://github.com/Wikid82/charon/releases
Root Cause
This error typically occurs when:
- Browser cached old JavaScript files that are incompatible with the new HTML template
- Docker image wasn't rebuilt after updating dependencies
- CDN or proxy cache is serving stale assets
React 19.2.3 and lucide-react@0.562.0 are fully compatible and tested. The issue is almost always environment-related, not a code bug.
Still Having Issues?
If the error persists after trying all fixes above, please report the issue with:
- Browser console screenshot (DevTools → Console tab, screenshot the full error)
- Browser name and version (e.g., Chrome 120.0.6099.109)
- Docker image tag (from
docker imagescommand) - Any browser extensions enabled (especially ad blockers or privacy tools)
- Steps to reproduce (what page you visited, what you clicked)
Open an issue at: https://github.com/Wikid82/charon/issues
Prevention
To avoid this issue in the future:
-
Always rebuild Docker images when upgrading Charon:
docker compose pull docker compose up -d --build -
Clear browser cache after major updates
-
Use versioned Docker tags instead of
:latestto avoid unexpected updates:image: ghcr.io/wikid82/charon:v0.4.0
Technical Background
React's production build uses optimized bundle splitting and code minification. When the browser caches old JavaScript chunks but receives a new HTML template, the chunks may reference objects that don't exist in the new bundle structure, causing "Cannot set properties of undefined" errors.
Verified Compatible Versions:
- React: 19.2.3
- React DOM: 19.2.3
- lucide-react: 0.562.0
- Vite: 7.3.0
All 1403 unit tests pass, and production builds succeed without errors. See diagnostic report for full test results.