Camera and permissions
The CharCam feature requires camera access, which can cause several issues.Camera permission denied
Browser blocks camera access
Browser blocks camera access
Problem: Error message “Camera permission denied” appears on
/chars page.Cause: User denied permission or browser blocked the request.Solution:- Check the address bar for a camera icon and click to allow permissions
- In Chrome: Settings → Privacy and Security → Site Settings → Camera
- In Firefox: Preferences → Privacy & Security → Permissions → Camera
- In Safari: Preferences → Websites → Camera
Camera access only works on localhost
Camera access only works on localhost
Problem: Camera works locally but not on deployed site.Cause:
navigator.mediaDevices.getUserMedia() requires HTTPS in production.Solution:- Deploy to platforms with automatic HTTPS (Vercel, Netlify)
- For custom hosting, configure SSL certificates
- Test locally using
https://localhostwith self-signed certificate
No camera found error
No camera found error
Problem: Browser says no camera is available.Cause: No physical camera connected or camera in use by another application.Solution:
- Verify camera is connected (for external webcams)
- Close other applications using the camera (Zoom, Teams, etc.)
- Restart the browser
- Check device manager (Windows) or system preferences (macOS) to ensure camera is recognized
Camera performance issues
CharCam is laggy or slow
CharCam is laggy or slow
Problem: ASCII art rendering has low frame rate or stutters.Cause: Large canvas size or high-resolution video processing.Solution:
The code already implements optimizations in
src/app/chars/page.tsx:- Low resolution video (
320x240) at line 136-137 - Reduced character set at line 6
- Dynamic font sizing based on screen width at line 9-14
- Efficient rendering with
requestAnimationFrameat line 128
Build and deployment issues
Build errors
Type errors during build
Type errors during build
Problem:
npm run build fails with TypeScript errors.Cause: Strict TypeScript settings or missing type definitions.Solution:- Run
npm run lintto see all errors - Fix type errors or add type assertions
- Check
tsconfig.json-strict: trueenforces strict typing
Module not found errors
Module not found errors
Problem: Build fails with “Cannot find module” errors.Cause: Missing dependencies or incorrect imports.Solution:Verify all imports use correct paths:
- Pages:
src/app/*/page.tsx - Components: Relative imports or
@/*alias (configured intsconfig.json:22)
Out of memory during build
Out of memory during build
Problem: Build process crashes with heap out of memory error.Cause: Insufficient memory allocation for Node.js.Solution:
Increase Node.js memory limit:
Deployment issues
Application won't start in production
Application won't start in production
Problem: Verify
npm start fails or returns errors.Cause: Build not completed or missing production dependencies.Solution:.next directory exists after build.Styles not loading in production
Styles not loading in production
Problem: Application works locally but styles are missing in production.Cause: Tailwind CSS not processing or PostCSS configuration issue.Solution:
- Verify
postcss.config.mjsexists in project root - Check
globals.csshas@import "tailwindcss";at the top - Ensure
globals.cssis imported insrc/app/layout.tsx:3 - Clear build cache and rebuild:
Browser compatibility
Canvas and MediaDevices support
Features not working in older browsers
Features not working in older browsers
Problem: Matrix rain or CharCam don’t work in some browsers.Cause: Missing browser APIs or outdated browser version.Required browser features:
- HTML5 Canvas API (Matrix rain)
navigator.mediaDevices.getUserMedia()(CharCam)- ES2017 JavaScript features
- Chrome 53+
- Firefox 36+
- Safari 11+
- Edge 79+
Mobile browser issues
Mobile browser issues
Problem: Application behaves differently on mobile.Solutions:
- Camera not accessible: Some mobile browsers restrict camera access in iframes or non-HTTPS contexts
- Performance: The code already implements responsive font sizing (
src/app/chars/page.tsx:9-14) - Layout issues: Canvas overflow is prevented with
overflow: hiddeninsrc/app/globals.css:20
playsInline attribute (src/app/chars/page.tsx:182) to prevent full-screen video on iOS.Development issues
Hot reload not working
Changes not reflected automatically
Changes not reflected automatically
Problem: Editing files doesn’t trigger automatic refresh.Cause: Turbopack or Fast Refresh issue.Solution:
- Restart dev server:
npm run dev - Clear browser cache (Cmd/Ctrl + Shift + R)
- Try without Turbopack:
- Check for syntax errors in the file you’re editing
Port already in use
Cannot start dev server on port 3000
Cannot start dev server on port 3000
Problem: Error “Port 3000 is already in use”.Solution:
Performance optimization
Matrix rain performance
Matrix rain effect is slow
Matrix rain effect is slow
Problem: Low frame rate or stuttering animation.Cause: Canvas size too large or too many columns.Solution:
Optimize in
src/app/page.tsx:Memory leaks
Application uses too much memory
Application uses too much memory
Problem: Browser tab memory usage increases over time.Cause: Animation frames not properly cleaned up.Solution:
The CharCam component already implements cleanup in Ensure you’re not creating multiple instances or keeping references to stopped components.
src/app/chars/page.tsx:169-177:Getting help
If you encounter issues not covered here:- Check the Next.js documentation
- Review browser console for error messages
- Search GitHub issues
- Check MDN Web Docs for browser API compatibility