Fix: Why does Cursor IDE freeze when running yarn serve:backend-*...
Documentation for Sessions
📝 Fix: Why does Cursor IDE freeze when running yarn serve:backend-*...
Date: 2026-02-10
Time: 17:48:03 UTC
Session: gspace1-102.12
Agent: backend
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Why does Cursor IDE freeze when running yarn serve:backend-* commands in the monorepo?
Task: Fix Cursor IDE freezing during yarn serve:backend-* - Session 102.3
🎯 Decision Made
Chosen:
Created .vscode/settings.json with files.watcherExclude for dist/, .nx/, tmp/, node_modules/, .angular/, coverage/, and .git/objects/. Also added files.exclude and search.exclude for the same directories. Additionally: capped webpack memory to 768MB per backend in dev-serve.js, disabled fork-ts-checker-webpack-plugin in development webpack configs, pruned 322 stale remote git branches (333 down to 11), configured selective git fetch (only main, session-102*, session-103*, deploy/*), and disabled git.autofetch in Cursor settings.
Options Considered:
- Only fix git branches
- Only fix webpack memory
- Fix all three root causes: file watcher exclusions + webpack memory + git branch pruning
💭 Reasoning
The freeze had THREE compounding causes: (1) NO files.watcherExclude configured — every webpack write to dist/ triggered Cursor's file watcher, which cascaded into git status checks, TypeScript server reprocessing, and search re-indexing, all competing for CPU during compilation. This was the PRIMARY cause. (2) Each backend webpack process ran with --max-old-space-size=2048 (2GB) and a separate fork-ts-checker process (~90MB). Three backends = 6GB+ just for webpack. Fixed by capping to 768MB and removing fork-ts-checker in dev (IDE handles type checking). (3) 333 remote git branches caused every git operation (fetch, status, log) to be slow. git.autofetch=true ran every 3 minutes, blocking the UI thread. Fixed by pruning to 11 branches, configuring selective fetch, and disabling autofetch. All three fixes together eliminated the freezes.
📁 Files Involved
.vscode/settings.jsontools/scripts/dev-serve.jsapis/backend-api/webpack.config.jsapis/backend-ai-api/webpack.config.jsapis/backend-vitto-api/webpack.config.js
🔗 Related
- Decision ID:
dev_1770745680009_thjtact - Session: 102
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation