Bugfix: Should dev-serve.js strip --port from CLI extra flags for ba...
Documentation for Sessions
🐛 Bugfix: Should dev-serve.js strip --port from CLI extra flags for ba...
Date: 2026-02-06
Time: 21:10:48 UTC
Session: editor2-97.12
Agent: backend
Confidence: 100%
Status: ✅ Documented
📋 Decision Context
Question:
Should dev-serve.js strip --port from CLI extra flags for backend apps?
Task: Harden dev-serve.js against CLI --port passthrough for backends
🎯 Decision Made
Chosen:
Also strip --port from user-supplied CLI args for backends
Options Considered:
- Only skip generating --port (current fix)
- Also strip --port from user-supplied CLI args for backends
- Block all extra flags for backends
💭 Reasoning
The initial fix only prevented dev-serve.js from generating --port for backends. But if a user or AI agent passes yarn serve:backend-ai --port 3001, the --port sneaks through as extraFlags and re-triggers the inspector port conflict. Since --port NEVER means 'app port' for @nx/js:node executors, it's always wrong to pass it. The script now strips --port from extraFlags for backends and prints a clear warning explaining why. This makes the foot-gun impossible to trigger through the dev-serve.js pathway.
📁 Files Involved
tools/scripts/dev-serve.js
🔗 Related
- Decision ID:
dev_1770412248504_nr7eue6 - Session: 97
- Workspace: editor2
Auto-generated by MCP Smart Consolidation