Files
low-code-react-app-b/scripts/fix-502.sh
johndoe6345789 d15d527473 Generated by Spark: 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/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)
2026-01-17 01:55:35 +00:00

74 lines
2.3 KiB
Bash
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/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