Skip to main content
Version: 1.0.0
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
  • Check Error Message - Read the full error message and stack trace
  • Verify Environment - Ensure .env.local is configured correctly
  • Check Dependencies - Run npm install to ensure packages are up to date
  • Clear Cache - Clear build-cache and restart dev server
  • Check Documentation - Review relevant guides (see Related Documentation)
  • Search Codebase - Look for similar patterns or error handling
  • Check Logs - Review browser console and terminal output

  • Build & Dependency Issues

    npm install Fails

    Symptoms

    • npm ERR! messages during installation
    • Package resolution errors
    • Permission denied errors

    Solutions

    1
  • Clear npm cache:
  • Check Node version:
  • Use correct package manager:
  • Check for conflicting packages:
  • TypeScript Build Errors

    Symptoms

    • TS2307: Cannot find module errors
    • Type mismatches
    • Missing type definitions

    Solutions

    1
  • Regenerate Supabase types:
  • Restart TypeScript server:
    • VS Code: Cmd/Ctrl + Shift + P → “TypeScript: Restart TS Server”
    • Or reload VS Code window
  • Check import paths:
  • Verify tsconfig.json:
    • Check paths configuration for @/ alias
    • Ensure include contains all source files

    Vite Build Errors

    Symptoms

    • Build fails with module resolution errors
    • “Cannot find module” in production build
    • Chunk loading errors

    Solutions

    1
  • Clear Vite cache:
  • Check for dynamic imports:
  • Verify environment variables:
    • All VITE_ prefixed variables must be set
    • Check .env.local exists and is properly formatted

    TypeScript Errors

    Missing Type Definitions

    Symptoms

    • TS2307: Cannot find module '@/...'
    • TS2339: Property '...' does not exist on type

    Solutions

    1
  • Regenerate Supabase types:
  • Install missing type packages:
  • Check tsconfig.json paths:
  • Type Mismatches

    Symptoms

    • TS2322: Type 'X' is not assignable to type 'Y'
    • Generic type errors

    Solutions

    1
  • Check component prop types:
  • Use type assertions carefully:
  • Check Supabase query return types:

  • Supabase Connection Issues

    ”Invalid Supabase URL” Error

    Symptoms

    • Connection fails on app load
    • “Invalid Supabase URL” error message

    Solutions

    1
  • Verify .env.local exists:
  • Check URL format:
  • Restart dev server:
  • CORS Errors

    Symptoms

    • CORS policy: No 'Access-Control-Allow-Origin' header
    • Requests blocked by browser

    Solutions

    1
  • Verify Supabase project URL:
    • Check VITE_SUPABASE_URL matches your Supabase project
    • Ensure project is active in Supabase Dashboard
  • Check Supabase CORS settings:
    • Supabase Dashboard → Settings → API
    • Verify allowed origins include your domain
  • For edge functions:
  • “Missing required environment variables” Error

    Symptoms

    • App fails to start
    • Error about missing Supabase variables

    Solutions

    1
  • Check .env.local file:
  • Verify variable names:
  • Copy from .env.example:
  • Restart dev server after changes

  • Supabase: Remote migration versions not found

    Symptoms

    • supabase db push fails with Remote 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 local supabase/migrations/ files.

    Resolution Steps

    1
  • Inspect remote history:
  • Compare with local files:
  • Reconcile each missing version:
    • 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
  • Re-run sync:
  • 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
  • Check Supabase auth configuration:
  • Check email/password format:
    • Email must be valid format
    • Password must meet Supabase requirements (min 6 characters)
  • Verify user exists:
    • Check Supabase Dashboard → Authentication → Users
    • Verify user is confirmed
  • Check browser console:
    • 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
  • Verify localStorage is enabled:
  • Check auth configuration:
  • Clear browser storage:
    • 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 user is authenticated:
  • Check RLS policies:
  • Verify organization context:

  • Performance Issues

    Slow Build Times

    Symptoms

    • npm run build takes > 5 minutes
    • Dev server slow to start

    Solutions

    1
  • Check bundle size:
  • Optimize imports:
  • Use lazy loading:
  • Check for circular dependencies:
  • Large Bundle Size

    Symptoms

    • Initial bundle > 500KB
    • Slow initial page load

    Solutions

    1
  • Analyze bundle:
  • Use code splitting:
  • Optimize images:
    • Use WebP format
    • Implement lazy loading for images
    • Use appropriate image sizes
  • Check for duplicate dependencies:
  • Slow Query Performance

    Symptoms

    • Queries take > 1 second
    • UI feels sluggish

    Solutions

    1
  • Check query optimization:
  • Use indexes:
    • Check Supabase Dashboard → Database → Indexes
    • Add indexes for frequently queried columns
  • Implement pagination:
  • Use QueryClient caching:

  • Mobile-Specific Issues

    Layout Breaks on Mobile

    Symptoms

    • Content overflows screen
    • Horizontal scrolling
    • Elements overlap

    Solutions

    1
  • Use responsive utilities:
  • Use PageContainer:
  • Check safe areas:
  • Test on actual devices:
    • 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

    1. Use minimum touch target size:
    2. Add adequate padding:

    Mobile Navigation Issues

    Symptoms

    • Bottom nav overlaps content
    • Menu not opening
    • Gestures not working

    Solutions

    1
  • Add bottom padding for nav:
  • Check z-index:
  • Verify gesture handlers:
    • Check @/platform/gestures imports
    • Verify gesture components are used correctly

    Cross-Browser Compatibility

    Safari-Specific Issues

    Symptoms

    • Layout breaks in Safari
    • CSS not applying correctly

    Solutions

    1
  • Check CSS vendor prefixes:
  • Verify safe area support:
  • Check localStorage support:
    • Safari in private mode blocks localStorage
    • Check for localStorage availability

    Chrome-Specific Issues

    Symptoms

    • Service worker not updating
    • Cache issues

    Solutions

    1. Clear service worker:
      • DevTools → Application → Service Workers
      • Click “Unregister”
      • Hard refresh (Ctrl+Shift+R)
    2. 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 and gh CLI are properly installed, authenticated, and connected to GitHub.

    Git Verification

    1
  • Check Git installation:
  • Verify user identity (required for commits):
    If empty, set them:
  • Verify repository connection:
  • Windows line endings (recommended):
  • See Git / Line Endings (Windows) for details.

    GitHub CLI (gh) Verification

    1
  • Check gh installation:
    If missing, install via: winget install GitHub.cli
  • Verify authentication:
    If not logged in, run: gh auth login
  • Verify repository access:
  • Check token scopes (if using GitHub Projects):
  • If missing, refresh with: gh auth refresh -s project

    Authentication Alignment

    Both Git and gh should use the same protocol (HTTPS or SSH):
    • HTTPS (recommended on Windows): Git remote should be https://github.com/... and gh auth status should show “Git operations protocol: https”
    • SSH: Git remote should be git@github.com:... and you should have SSH keys configured
    If Git uses HTTPS but 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.com succeeds

    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 status or git diff shows “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
  • Tell Git to keep LF in the working copy (in this repo):
    With input, Git does not convert to CRLF on checkout, so files stay LF.
  • Rewrite working copy to LF so it matches the index (Biome is already set to lineEnding: "lf"):
    This rewrites all formatted files to LF. After this, git status should show no (or far fewer) changes.
  • Optional: If you still see line-ending diffs in other files (e.g. outside Biome’s scope), refresh the index:
  • Prevention

    • The repo’s .gitattributes now uses * text=auto eol=lf so that all text files use LF on checkout, regardless of OS.
    • Keep core.autocrlf input in this repo so Windows does not introduce CRLF again.

    Quick Reference Table


    Setup & Configuration

    Development Guides

    Standards


    Maintained By: Platform Foundation Team