Skip to main content

Troubleshooting

Common issues encountered when developing or deploying CommonPlace.

Development Issues

"Supabase connection failed"

Cause: Invalid or missing environment variables.

Solution:

  1. Check .env file exists
  2. Verify VITE_SUPABASE_URL is correct
  3. Verify VITE_SUPABASE_ANON_KEY is correct
  4. Restart dev server after changes

"Module not found"

Cause: Dependencies not installed.

Solution:

rm -rf node_modules
npm install

"Port already in use"

Cause: Another process is using port 5173.

Solution:

# Find the process
lsof -i :5173

# Kill it
kill -9 <PID>

# Or use a different port
npm run dev -- --port 3000

"RLS policy error"

Cause: Row Level Security blocking query.

Solution:

  1. Check you're authenticated
  2. Verify the RLS policy allows your action
  3. Check the auth.uid() matches expected user

Build Issues

"Failed to resolve import"

Cause: Missing or incorrect import path.

Solution:

  1. Check the file exists
  2. Verify the export name
  3. Check for typos in the path

"TypeScript errors"

Cause: Type mismatches.

Solution:

  1. Run npm run typecheck
  2. Fix reported errors
  3. Use // @ts-ignore sparingly

Database Issues

"Permission denied"

Cause: RLS policy blocking access.

Solution:

  1. Check you're signed in
  2. Verify the policy exists
  3. Test in SQL Editor with auth.uid() set

"Duplicate key"

Cause: Unique constraint violation.

Solution:

  1. Check if record already exists
  2. Use UPSERT if appropriate
  3. Handle conflict in application code

Deployment Issues

"Build failed on Netlify"

Cause: Build configuration issue.

Solution:

  1. Check netlify.toml is correct
  2. Verify Node version
  3. Check build logs for specific error

"404 on refresh"

Cause: Client-side routing not configured.

Solution: Ensure _redirects or netlify.toml has:

/* /index.html 200

Last updated: 2026-02-07