mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-04-24 13:44:54 +00:00
ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/src/main.tsx:1 Failed to load resource: the server responded with a status of 502 ()Understand this error (index):5 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@react-refresh net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@react-refresh:1 Failed to load resource: the server responded with a status of 502 ()Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@react-refresh:1 Failed to load resource: the server responded with a status of 502 ()Understand this error console.ts:4 FileSyncerContext: Established connection to file syncer console.ts:4 FileSyncerContext: FileSyncer client created and connected console.ts:4 FileSyncerContext: Codespaces file syncer started console.ts:4 FileSyncerContext: Established connection to file syncer console.ts:4 FileSyncerContext: FileSyncer client created and connected console.ts:4 FileSyncerContext: Codespaces file syncer started console.ts:4 connected to the Codespace ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:10 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@vite/client net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@vite/client:1 Failed to load resource: the server responded with a status of 502 ()Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:32 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/workspaces/spark-template/packages/spark-tools/dist/heartbeat.js net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/workspaces/spark-template/packages/spark-tools/dist/heartbeat.js:1 Failed to load resource: the server responded with a status of 502 ()Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:37 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/src/main.tsx net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/src/main.tsx:1 Failed to load resource: the server responded with a status of 502 ()Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:5 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@react-refresh net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@react-refresh:1 Failed to load resource: the server responded with a status of 502 ()Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:10 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@vite/client net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:32 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/workspaces/spark-template/packages/spark-tools/dist/heartbeat.js net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:37 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/src/main.tsx net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:5 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@react-refresh net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:10 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@vite/client net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:32 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/workspaces/spark-template/packages/spark-tools/dist/heartbeat.js net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:37 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/src/main.tsx net::ERR_ABORTED 502 (Bad Gateway)Understand this error ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/:5 GET https://ubiquitous-couscous-97464jg9j6ggh79x5-5000.app.github.dev/@react-refresh net::ERR_ABORTED 502 (Bad Gateway)
74 lines
2.3 KiB
Bash
74 lines
2.3 KiB
Bash
#!/bin/bash
|
||
|
||
# Quick fix script for 502 Bad Gateway errors
|
||
# This script automates the common fix steps
|
||
|
||
echo "🔧 502 Bad Gateway Quick Fix"
|
||
echo "════════════════════════════════════════════════════════════"
|
||
echo ""
|
||
|
||
# Step 1: Kill existing processes
|
||
echo "1️⃣ Killing existing processes on port 5000..."
|
||
if lsof -i :5000 >/dev/null 2>&1; then
|
||
fuser -k 5000/tcp 2>/dev/null || true
|
||
sleep 1
|
||
echo " ✅ Killed processes on port 5000"
|
||
else
|
||
echo " ℹ️ No processes on port 5000"
|
||
fi
|
||
echo ""
|
||
|
||
# Step 2: Kill processes on old port (5173)
|
||
echo "2️⃣ Killing processes on old port (5173)..."
|
||
if lsof -i :5173 >/dev/null 2>&1; then
|
||
fuser -k 5173/tcp 2>/dev/null || true
|
||
sleep 1
|
||
echo " ✅ Killed processes on port 5173"
|
||
else
|
||
echo " ℹ️ No processes on port 5173"
|
||
fi
|
||
echo ""
|
||
|
||
# Step 3: Verify vite.config.ts
|
||
echo "3️⃣ Verifying vite.config.ts..."
|
||
if grep -q "port: 5000" vite.config.ts; then
|
||
echo " ✅ Configuration correct (port 5000)"
|
||
else
|
||
echo " ❌ Configuration incorrect!"
|
||
echo " → Manual fix needed: Update vite.config.ts port to 5000"
|
||
exit 1
|
||
fi
|
||
echo ""
|
||
|
||
# Step 4: Check dependencies
|
||
echo "4️⃣ Checking dependencies..."
|
||
if [ ! -d "node_modules" ]; then
|
||
echo " ⚠️ node_modules not found, installing dependencies..."
|
||
npm install
|
||
echo " ✅ Dependencies installed"
|
||
else
|
||
echo " ✅ Dependencies present"
|
||
fi
|
||
echo ""
|
||
|
||
# Step 5: Clear Vite cache
|
||
echo "5️⃣ Clearing Vite cache..."
|
||
if [ -d "node_modules/.vite" ]; then
|
||
rm -rf node_modules/.vite
|
||
echo " ✅ Vite cache cleared"
|
||
else
|
||
echo " ℹ️ No Vite cache to clear"
|
||
fi
|
||
echo ""
|
||
|
||
# Step 6: Start dev server
|
||
echo "6️⃣ Starting dev server..."
|
||
echo ""
|
||
echo "════════════════════════════════════════════════════════════"
|
||
echo "🚀 Starting Vite dev server on port 5000..."
|
||
echo " Press Ctrl+C to stop"
|
||
echo "════════════════════════════════════════════════════════════"
|
||
echo ""
|
||
|
||
npm run dev
|