npm run dev Swallows Port Output, Preventing AI Coding Agents from Detecting Dev Server Startup
#2.010 aberto em 21 de mai. de 2026
Métricas do repositório
- Stars
- (48.085 stars)
- Métricas de merge de PR
- (Mesclagem média 11d 1h) (45 fundiu PRs em 30d)
Description
npm run dev Swallows Port Output, Preventing AI Coding Agents from Detecting Dev Server Startup
Problem
When running npm run dev through RTK, the dev server's port number output is completely suppressed. The terminal shows no startup information such as Local: http://localhost:3000.
This prevents AI coding assistants (Claude Code, Cursor, GitHub Copilot Agent, etc.) that rely on stdout/stderr to determine project running status from detecting:
- Whether the dev server has started successfully
- Which port the server is listening on
Consequences
- Port conflicts — the AI agent may attempt to start another dev server, occupying a different port or failing entirely
- Unable to construct preview URLs — the agent cannot open or reference the running application
- Incorrect suggestions — the agent assumes the project is not running and provides misleading guidance
Steps to Reproduce
- Run
npm run devin the project root - Observe terminal output — no port information is printed
- Compare with running the underlying tool directly (e.g.
npx vite/npx next dev) — port info is printed normally
Expected Behavior
After npm run dev starts, stdout should contain parseable port information, for example:
➜ Local: http://localhost:5173/
➜ Network: http://192.168.1.100:5173/
At minimum, a single line containing localhost:<port> or 127.0.0.1:<port> should be emitted so that downstream tools and AI agents can extract the port via pattern matching.
Environment
- RTK version:
0.37.0 - Node:
v18.20.4 - OS: macOS
- Package manager: npm
References
- Vite: prints
Local: http://localhost:xxxx/to stdout on startup - Next.js: prints
- Local: http://localhost:xxxxto stdout on startup - AI agents depend on stdout port information to determine dev server readiness and avoid duplicate launches