rtk-ai/rtk

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

Open

#2,010 创建于 2026年5月21日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Rust (2,914 fork)batch import
area:clibughelp wantedpriority:high

仓库指标

Star
 (48,085 star)
PR 合并指标
 (平均合并 11天 1小时) (30 天内合并 45 个 PR)

描述

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

贡献者指南