rtk-ai/rtk

npm run dev Swallows Port Output, Preventing AI Coding Agents from Detecting Dev Server Startup

Open

#2010 aperta il 21 mag 2026

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Rust (2914 fork)batch import
area:clibughelp wantedpriority:high

Metriche repository

Star
 (48.085 star)
Metriche merge PR
 (Merge medio 11g 1h) (45 PR mergiate in 30 g)

Descrizione

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

  1. Run npm run dev in the project root
  2. Observe terminal output — no port information is printed
  3. 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:xxxx to stdout on startup
  • AI agents depend on stdout port information to determine dev server readiness and avoid duplicate launches

Guida contributor