Last Updated: 2025-01-27
Status: Stable
Target Audience: Developers Troubleshooting common development issues in the Encore OS Platform.
Quick Reference
For detailed solutions, see sections below.
Diagnostic Workflow
When encountering an issue, follow this workflow:1
.env.local is configured correctlynpm install to ensure packages are up to dateBuild & Dependency Issues
npm install Fails
Symptoms
npm ERR!messages during installation- Package resolution errors
- Permission denied errors
Solutions
1
TypeScript Build Errors
Symptoms
TS2307: Cannot find moduleerrors- Type mismatches
- Missing type definitions
Solutions
1
- VS Code:
Cmd/Ctrl + Shift + P→ “TypeScript: Restart TS Server” - Or reload VS Code window
- Check
pathsconfiguration for@/alias - Ensure
includecontains all source files
Vite Build Errors
Symptoms
- Build fails with module resolution errors
- “Cannot find module” in production build
- Chunk loading errors
Solutions
1
- All
VITE_prefixed variables must be set - Check
.env.localexists and is properly formatted
TypeScript Errors
Missing Type Definitions
Symptoms
TS2307: Cannot find module '@/...'TS2339: Property '...' does not exist on type
Solutions
1
Type Mismatches
Symptoms
TS2322: Type 'X' is not assignable to type 'Y'- Generic type errors
Solutions
1
Supabase Connection Issues
”Invalid Supabase URL” Error
Symptoms
- Connection fails on app load
- “Invalid Supabase URL” error message
Solutions
1
.env.local exists:
CORS Errors
Symptoms
CORS policy: No 'Access-Control-Allow-Origin' header- Requests blocked by browser
Solutions
1
- Check
VITE_SUPABASE_URLmatches your Supabase project - Ensure project is active in Supabase Dashboard
- Supabase Dashboard → Settings → API
- Verify allowed origins include your domain
“Missing required environment variables” Error
Symptoms
- App fails to start
- Error about missing Supabase variables
Solutions
1
.env.local file:
.env.example:
Supabase: Remote migration versions not found
Symptoms
supabase db pushfails withRemote migration versions not found in local migrations directory- CI or deployment jobs fail while reconciling migration history
Root Cause
Remote migration history contains versions that do not exist in localsupabase/migrations/ files.
Resolution Steps
1
- Preferred: recreate the missing migration SQL file with the exact remote version and commit it
- If no-op: add a placeholder migration file documenting why it is empty
Prevention
- Always create migration files first (
supabase migration new ...) - Commit migration files before applying to remote
- Avoid direct schema changes in Supabase Dashboard without corresponding migration files
Authentication Problems
Login Fails
Symptoms
- Login button does nothing
- Error message on login attempt
- Redirects back to login page
Solutions
1
- Email must be valid format
- Password must meet Supabase requirements (min 6 characters)
- Check Supabase Dashboard → Authentication → Users
- Verify user is confirmed
- Look for error messages
- Check Network tab for failed requests
Session Not Persisting
Symptoms
- User logged out on page refresh
- Session lost after closing browser
Solutions
1
- Open DevTools → Application → Storage
- Clear localStorage and sessionStorage
- Try logging in again
”Unauthorized” Errors
Symptoms
- API calls return 401 Unauthorized
- RLS policies blocking access
Solutions
1
- Verify policies exist for the table
- Check policy conditions match user context
- See Database Development Guide for RLS patterns
Performance Issues
Slow Build Times
Symptoms
npm run buildtakes > 5 minutes- Dev server slow to start
Solutions
1
Large Bundle Size
Symptoms
- Initial bundle > 500KB
- Slow initial page load
Solutions
1
- Use WebP format
- Implement lazy loading for images
- Use appropriate image sizes
Slow Query Performance
Symptoms
- Queries take > 1 second
- UI feels sluggish
Solutions
1
- Check Supabase Dashboard → Database → Indexes
- Add indexes for frequently queried columns
Mobile-Specific Issues
Layout Breaks on Mobile
Symptoms
- Content overflows screen
- Horizontal scrolling
- Elements overlap
Solutions
1
- Use browser dev tools mobile emulation
- Test on real iOS/Android devices
Touch Targets Too Small
Symptoms
- Buttons hard to tap
- Links difficult to click
Solutions
-
Use minimum touch target size:
-
Add adequate padding:
Mobile Navigation Issues
Symptoms
- Bottom nav overlaps content
- Menu not opening
- Gestures not working
Solutions
1
- Check
@/platform/gesturesimports - Verify gesture components are used correctly
Cross-Browser Compatibility
Safari-Specific Issues
Symptoms
- Layout breaks in Safari
- CSS not applying correctly
Solutions
1
- Safari in private mode blocks localStorage
- Check for localStorage availability
Chrome-Specific Issues
Symptoms
- Service worker not updating
- Cache issues
Solutions
-
Clear service worker:
- DevTools → Application → Service Workers
- Click “Unregister”
- Hard refresh (Ctrl+Shift+R)
-
Clear cache:
- DevTools → Application → Clear storage
- Clear site data
Git & GitHub CLI Connectivity
Verifying Git and GitHub CLI Setup
Use this checklist to verify Git andgh CLI are properly installed, authenticated, and connected to GitHub.
Git Verification
1
GitHub CLI (gh) Verification
1
gh installation:
winget install GitHub.cli
gh auth login
gh auth refresh -s project
Authentication Alignment
Both Git andgh should use the same protocol (HTTPS or SSH):
- HTTPS (recommended on Windows): Git remote should be
https://github.com/...andgh auth statusshould show “Git operations protocol: https” - SSH: Git remote should be
git@github.com:...and you should have SSH keys configured
gh uses SSH (or vice versa), they may not share credentials. Align them:
- For HTTPS: Ensure Git Credential Manager is installed (
git credential-manager --version) - For SSH: Ensure
ssh -T git@github.comsucceeds
Common Issues
Related: See GITHUB_PROJECT_SPEC_TRACKING_PLAN.md for GitHub Projects integration requirements.
Git / Line Endings (Windows)
Mass “changes” every time you reload the window
Symptoms
- After reloading the Cursor/VS Code window (or opening the project), Git shows hundreds of files as modified.
git statusorgit diffshows “LF will be replaced by CRLF” (or similar) for many files.- You did not edit those files; the only difference is line endings.
Cause
On Windows, Git can be configured to convert line endings to CRLF in the working copy while the repo stores LF. When the editor or Git “touches” files (e.g. on window reload), the mismatch makes every such file appear changed.One-time fix (do this once)
1
input, Git does not convert to CRLF on checkout, so files stay LF.
lineEnding: "lf"):
git status should show no (or far fewer) changes.
Prevention
- The repo’s
.gitattributesnow uses* text=auto eol=lfso that all text files use LF on checkout, regardless of OS. - Keep
core.autocrlf inputin this repo so Windows does not introduce CRLF again.
Quick Reference Table
Related Documentation
Setup & Configuration
- Environment Variables - Environment variable configuration
- Setup Quick Start - First-time developer setup
- PWA Setup - PWA configuration and troubleshooting
Development Guides
- Database Development Guide - Database and RLS troubleshooting
- Performance Optimization Guide - Performance debugging
- Testing Setup and Run Guide - Test setup and debugging
Standards
- UI/UX Standards - UI/UX troubleshooting
- Spacing & UX Standards - Spacing issues
- Constitution - Core requirements and guardrails
Maintained By: Platform Foundation Team