You're seeing errors like:
GET https://soham-ai.vercel.app/_next/static/chunks/fd37fa83-2fca480fd0fc6fa6.js net::ERR_ABORTED 404
Refused to execute script because its MIME type ('text/html') is not executable
Netlify is serving an old cached build. The JavaScript chunks from the previous build don't match the current deployment. This happens when:
- Build cache contains old chunk references
- Service worker cached old chunk URLs
- Browser cached old HTML with old chunk references
Option A: Using Netlify UI (Recommended)
- Go to https://app.netlify.com/
- Select your site: codeex-ai
- Go to Site settings → Build & deploy → Build settings
- Scroll down and click Clear cache and retry deploy
- Wait for the new build to complete
Option B: Using Netlify CLI
netlify build --clear-cache
netlify deploy --prodAfter the new build is deployed, users need to clear their service worker cache:
For You (Developer):
- Open https://soham-ai.vercel.app in Chrome
- Press F12 to open DevTools
- Go to Application tab
- Click Service Workers in left sidebar
- Click Unregister next to your service worker
- Go to Storage in left sidebar
- Click Clear site data
- Hard refresh: Ctrl+Shift+R (Windows) or Cmd+Shift+R (Mac)
For Users: They'll need to do the same, or you can add a version check to force service worker update.
- Open https://soham-ai.vercel.app in an incognito window
- Open DevTools (F12) → Network tab
- Refresh the page
- Check that all JavaScript chunks load with 200 status (not 404)
- Try navigating to different pages
- Check console for errors
To automatically force service worker updates, we can add a version check. This will help prevent this issue in the future.
Add this to your next.config.js in the PWA workboxOptions:
workboxOptions: {
// ... existing options
buildId: process.env.BUILD_ID || Date.now().toString(),
}This will force the service worker to update when the build ID changes.
When you make significant changes (like we did), always clear Netlify cache:
# Before deploying
git commit -m "Major update"
git push origin main
# Then in Netlify UI: Clear cache and retry deployNetlify automatically generates build IDs, but we can make them more explicit:
In netlify.toml, add:
[build.environment]
BUILD_ID = "${COMMIT_REF}"Consider adding a "New version available" notification to prompt users to refresh.
- ✅ Code pushed to GitHub (commit: 3a09764)
- ✅
.netlify-rebuildfile updated to force cache clear ⚠️ ACTION REQUIRED: Clear Netlify build cache (see Step 1 above)⚠️ ACTION REQUIRED: Clear browser/service worker cache (see Step 2 above)
# 1. Update the rebuild trigger file (already done)
echo "# Force rebuild $(date)" > .netlify-rebuild
# 2. Commit and push
git add .netlify-rebuild
git commit -m "Force Netlify cache clear"
git push origin main
# 3. Then go to Netlify UI and click "Clear cache and retry deploy"Next.js generates unique chunk names based on content hashes. When you:
- Build locally → generates chunks like
4241-876245a25c4c5b5d.js - Deploy to Netlify → Netlify caches the build
- Make changes and deploy again → generates NEW chunks like
4241-abc123def456.js - But Netlify cache still references OLD chunks
- Browser tries to load old chunks → 404 error
The solution is to clear ALL caches (Netlify build cache, service worker cache, browser cache).
Once you've cleared all caches and redeployed:
# Test in incognito mode
# 1. Open https://soham-ai.vercel.app
# 2. Check console for errors
# 3. Navigate to different pages
# 4. Try AI chat
# 5. Check TTS functionalityAll JavaScript chunks should load successfully with 200 status codes.
Next Steps:
- Go to Netlify dashboard
- Click "Clear cache and retry deploy"
- Wait for build to complete
- Test in incognito window
- If still issues, clear service worker cache (Step 2)