Common issues and solutions when working with the Quart + React demo app.
Problem:
bash: python3: command not foundSolution:
# Ubuntu/Debian
sudo apt update
sudo apt install python3 python3-pip python3-venv
# Verify installation
python3 --versionProblem:
bash: node: command not foundSolution:
# Install Node.js 20.x
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Verify installation
node --version
npm --versionProblem:
source .venv/bin/activate # Does nothingSolution:
# Run these commands from the repo root
# Remove old .venv if it exists
rm -rf .venv
# Create new virtual environment at the top level
python3 -m venv .venv
# Activate it
source .venv/bin/activate
# You should see (.venv) in your prompt
# Install backend dependencies
pip install -r backend/requirements.txtProblem:
bash: ./setup.sh: Permission deniedSolution:
# Make scripts executable
chmod +x setup.sh start-dev.sh
# Now run them
./setup.shImportant: This project uses port 5001 for the backend (not 5000) because on macOS Monterey and later, port 5000 is used by AirPlay Receiver.
Problem:
Error: Address already in use
Solution:
# Find process using port 5001
sudo lsof -i :5001
# Kill the process (replace PID with actual process ID)
sudo kill -9 <PID>macOS AirPlay Issue: If you see port 5000 conflicts on macOS:
- Go to System Preferences → Sharing
- Uncheck "AirPlay Receiver"
- Or use a different port (we've already changed to 5001)
Problem:
ModuleNotFoundError: No module named 'quart'Solution:
# Make sure virtual environment is activated
source .venv/bin/activate
# You should see (.venv) in your prompt
# Reinstall dependencies
pip install -r backend/requirements.txt
# If still having issues
pip install --upgrade pip
pip install -r backend/requirements.txt --force-reinstallProblem:
Access to fetch at 'http://localhost:5001/api/tasks' from origin
'http://localhost:3001' has been blocked by CORS policy
Solution:
This should already be handled by quart-cors in the backend, but if you see this:
# Make sure quart-cors is installed
source .venv/bin/activate
cd backend
pip install quart-cors
# Verify it's in requirements.txt
cat requirements.txtProblem:
Traceback (most recent call last):
File "app.py", line X
Solution:
# Check Python version (needs 3.10+)
python3 --version
# Make sure you're in the right directory
cd backend
# Make sure virtual environment is activated
source ../.venv/bin/activate
# Try running with more verbose output
python app.pyProblem:
Port 3001 is in use, trying another port...
Solution:
# Option 1: Kill the process using port 3001
sudo lsof -i :3001
sudo kill -9 <PID>
# Option 2: Update vite.config.js to another open port (e.g., 3002)
# server: { port: 3002 }Problem:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
Solution:
cd frontend
# Clear npm cache
npm cache clean --force
# Remove old files
rm -rf node_modules package-lock.json
# Try installing with legacy peer deps
npm install --legacy-peer-deps
# Or force install
npm install --forceProblem:
Failed to resolve import "@fluentui/react-components"
Solution:
cd frontend
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install
# If specific package is missing
npm install @fluentui/react-componentsProblem:
error during build:
Error: Build failed with X errors
Solution:
# Clear Vite cache
rm -rf frontend/node_modules/.vite
# Restart dev server
cd frontend
npm run devProblem: Browser shows blank page, no errors in terminal.
Solution:
# Check browser console (F12)
# Look for JavaScript errors
# Common causes:
# 1. Backend not running
source .venv/bin/activate
cd backend
python app.py
# 2. Check API proxy in vite.config.js
# Should have:
# proxy: {
# '/api': {
# target: 'http://localhost:5001',
# changeOrigin: true,
# }
# }Enable verbose logging:
# In backend/app.py
import logging
logging.basicConfig(level=logging.DEBUG)Print debugging:
# Add print statements
print(f"Tasks: {tasks_db}")
print(f"Received data: {data}")Use VSCode debugger:
- Open VSCode
- Set breakpoint in
backend/app.py - Press F5
- Select "Python: Quart Backend"
- Interact with app
- Execution stops at breakpoint
Browser DevTools:
# Open browser console: F12 or Ctrl+Shift+I
# Check tabs:
# - Console: JavaScript errors
# - Network: API calls and responses
# - Elements: Inspect DOM
# - React DevTools: Component state (install extension)Console logging:
// Add to component
console.log('Tasks:', tasks)
console.log('State:', { filter, loading, error })React DevTools:
# Install React DevTools browser extension
# Then in browser:
# F12 → Components tab → Click component → See props/stateVSCode debugging:
- Start frontend:
npm run dev - Press F5 in VSCode
- Select "Chrome: React Frontend"
- Set breakpoints in
.jsxfiles - Interact with app in opened browser
Check API calls:
# In browser DevTools → Network tab:
# 1. Reload page
# 2. Filter by XHR/Fetch
# 3. Click on request
# 4. Check:
# - Request URL
# - Status code
# - Request payload
# - Response dataTest API directly:
# Test backend endpoints with curl
curl http://localhost:5001/api/health
curl http://localhost:5001/api/date
curl http://localhost:5001/api/tasks
# Create a task
curl -X POST http://localhost:5001/api/tasks \
-H "Content-Type: application/json" \
-d '{"title":"Test task","description":"Testing"}'Problem:
Failed to install browsers
Solution:
# Install system dependencies first
sudo npx playwright install-deps
# Then install browsers
npx playwright install
# If on Ubuntu and having issues:
sudo apt-get update
sudo apt-get install -y \
libnss3 \
libnspr4 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libdbus-1-3 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libpango-1.0-0 \
libcairo2 \
libasound2Problem:
Error: connect ECONNREFUSED 127.0.0.1:3001
Solution:
# Make sure both servers are running
# Terminal 1
source .venv/bin/activate
cd backend
python app.py
# Terminal 2
cd frontend
npm run dev
# Terminal 3 (wait for both to start)
npm run test:e2eProblem:
Test timeout of 30000ms exceeded
Solution:
# Increase timeout in playwright.config.js
# Add to config:
# timeout: 60000, // 60 seconds
# Or in specific test:
test('my test', async ({ page }) => {
// ...
}, { timeout: 60000 })-
Are you in the right directory?
pwd # Should show path ending in /python-quart-vite-react
-
Is the virtual environment activated? (for backend work)
# Should see (.venv) in your prompt- Are both servers running?
# Backend should show: # * Running on http://0.0.0.0:5001 # Frontend should show: # VITE v5.x.x ready in XXX ms
➜ Local: http://localhost:3001/
4. **Check browser console for errors** (F12)
5. **Check terminal output for errors**
### Get More Help
1. Read the full [README.md](../README.md)
2. Check [LEARNING.md](LEARNING.md) for code explanations
3. Review [PROJECT_STRUCTURE.md](PROJECT_STRUCTURE.md) for file locations
### Clean Slate Approach
If all else fails, start fresh:
```bash
# Backend
rm -rf .venv
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r backend/requirements.txt
# Frontend
cd frontend
rm -rf node_modules package-lock.json
npm install
# Root (for Playwright)
cd ..
rm -rf node_modules package-lock.json
npm install
npx playwright install
Then try running again:
./start-dev.sh- Always activate virtual environment when working with backend
- Keep dependencies updated periodically
- Check terminal output for warnings
- Use VSCode debugger instead of print statements
- Test one change at a time to isolate issues
- Read error messages carefully - they usually tell you what's wrong!
Happy debugging! 🐛🔧