docs: Update setup and troubleshooting guides
- Add Docker build troubleshooting section - Update Quick Start with SSL cert and public dir steps - Add prisma db push instruction for database setup - Document common build errors and solutions
This commit is contained in:
+73
-1
@@ -170,6 +170,78 @@ sudo mkswap /swapfile
|
||||
sudo swapon /swapfile
|
||||
```
|
||||
|
||||
## Docker Build Issues
|
||||
|
||||
### Backend Build Fails: Cannot redeclare block-scoped variable
|
||||
|
||||
**Error:** `error TS2451: Cannot redeclare block-scoped variable 'signature'`
|
||||
|
||||
**Solution:** Fixed in source. If you see this, pull the latest code.
|
||||
|
||||
### Backend: Prisma Client could not locate Query Engine
|
||||
|
||||
**Error:** `PrismaClientInitializationError: Prisma Client could not locate the Query Engine`
|
||||
|
||||
**Solution:**
|
||||
```bash
|
||||
# Regenerate Prisma client with correct binary target
|
||||
cd backend
|
||||
npx prisma generate
|
||||
|
||||
# Rebuild backend container
|
||||
docker-compose up -d --build backend
|
||||
```
|
||||
|
||||
### Frontend Build Fails: Module not found
|
||||
|
||||
**Error:** `Module not found: Can't resolve '@/components/ui/...'`
|
||||
|
||||
**Solution:** Ensure `tsconfig.json` has correct paths:
|
||||
```json
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
```
|
||||
|
||||
### Frontend: Prerender Error on /login
|
||||
|
||||
**Error:** `Error occurred prerendering page "/login"`
|
||||
|
||||
**Solution:** This was caused by zustand persist middleware accessing localStorage during SSR. Fixed by wrapping providers with dynamic import `ssr: false`.
|
||||
|
||||
### Frontend: Cannot find module 'next-themes'
|
||||
|
||||
**Error:** `Module not found: Can't resolve 'next-themes'`
|
||||
|
||||
**Solution:**
|
||||
```bash
|
||||
cd frontend
|
||||
npm install next-themes
|
||||
```
|
||||
|
||||
### Nginx: SSL Certificate Error
|
||||
|
||||
**Error:** `cannot load certificate "/etc/nginx/ssl/cert.pem"`
|
||||
|
||||
**Solution:**
|
||||
```bash
|
||||
mkdir -p docker/nginx/ssl
|
||||
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
|
||||
-keyout docker/nginx/ssl/key.pem \
|
||||
-out docker/nginx/ssl/cert.pem \
|
||||
-subj "/CN=coop.hobokenchicken.com"
|
||||
```
|
||||
|
||||
### Docker Compose: Public Directory Not Found
|
||||
|
||||
**Error:** `failed to calculate checksum: "/app/frontend/public": not found`
|
||||
|
||||
**Solution:**
|
||||
```bash
|
||||
mkdir -p frontend/public
|
||||
touch frontend/public/.gitkeep
|
||||
```
|
||||
|
||||
## Getting Help
|
||||
|
||||
1. Check health status:
|
||||
@@ -190,5 +262,5 @@ sudo swapon /swapfile
|
||||
4. Verify environment:
|
||||
```bash
|
||||
# Check all required env vars are set
|
||||
grep -E '^\w+=' .env | wc -l
|
||||
grep -E '^\w+=' .env | wc -l
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user