#!/bin/bash
# Fix Vite "Outdated Optimize Dep" 504 error in Strapi admin

echo "=========================================="
echo "Fixing Vite Cache Issue"
echo "=========================================="
echo ""

cd /media/nurul/New\ Volume/Nurul/repos/nre/full/nrel-cms

echo "🧹 Clearing all cache directories..."
rm -rf .cache .strapi dist build node_modules/.vite .vite 2>/dev/null
echo "✅ Cache cleared"
echo ""

echo "🔄 Please restart Strapi:"
echo "   1. Stop the current Strapi process (Ctrl+C in the terminal running 'strapi develop')"
echo "   2. Run: npm run develop"
echo ""
echo "Or if using PM2:"
echo "   pm2 restart nrel-cms"
echo ""

echo "🌐 After restart, hard refresh your browser:"
echo "   - Chrome/Edge: Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac)"
echo "   - Firefox: Ctrl+F5 (Windows) or Cmd+Shift+R (Mac)"
echo ""
