devtools-vite: `consolePiping` defaults can balloon dev logs to many GB when a hot warning loops
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- react, typescript, vite
Hướng nghiên cứu
Tái hiện với vite.config.ts được đề cập, component React nested-button và lệnh nohup, sau đó lần theo đường dẫn consolePiping được devtools() đi vào. So sánh các tùy chọn được đề xuất về giá trị mặc định, loại bỏ trùng lặp, giới hạn tốc độ và volume-cap; được xem là hoàn tất khi các cảnh báo lặp lại không còn khuếch đại log máy chủ không giới hạn, trong khi cảnh báo trên trình duyệt vẫn khả dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Claude here — opening this on David's behalf after we hit it on a TanStack Start project.
Summary
@tanstack/devtools-vite (v0.6.0) ships with consolePiping.enabled: true and levels: ['log', 'warn', 'error', 'info', 'debug'] by default. When a Vite dev server runs unattended and the page produces a recurring console warning (any persistent React render-loop warning will do), the plugin pipes each occurrence twice ([Server] then [Client]) and React's hydration messages bring the full component tree along for the ride. With no dedup, rate-limit, or volume cap, this can write tens of GB to disk in a few hours — we hit a 105 GB log file before noticing.
Related but distinct: #342 (closed) — same subsystem, different symptom (request stalling).
Reproduction
Minimal TanStack Start project. The exact warning trigger doesn't matter; any render-loop warning will reproduce. Easiest case: a hydration error from invalid HTML nesting.
vite.config.ts:
import { defineConfig } from 'vite'
import { devtools } from '@tanstack/devtools-vite'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
export default defineConfig({
plugins: [devtools(), tanstackStart(), viteReact()],
})
A component with nested interactive elements (React 19 will warn on every render):
export default function Card() {
return (
<button onClick={() => {}}>
<button onClick={(e) => e.stopPropagation()}>nested</button>
</button>
)
}
Start dev with output redirected to a file (typical CI / nohup setup):
nohup pnpm dev > dev.log 2>&1 &
Visit the page and leave the tab open. dev.log grows continuously. After a few hours it's GBs; on our project it reached 105 GB before we noticed and ran out of disk pressure on \$TMPDIR.
Why it explodes
Each repeat of the same warning produces:
- A server-side log line.
- The client emits the same warning, which the plugin pipes back to the server.
- The server emits its piped copy back to the client.
- React 19's hydration error messages include the full component tree (every
<SafeFragment>,<MatchInnerImpl>, every leaf component, withdata-tsd-sourceannotations). This is a large payload per occurrence. - The warning fires on every render attempt, which for a hydration mismatch is many times per second.
There is no dedup of identical messages within a window, no rate-limit on emissions, and no overall log volume cap.
Defaults question
consolePiping is a debug-aid feature. For typical dev workflows the warning already shows in the browser console and the terminal — piping is mostly useful when actively debugging the bridge itself. Having it on by default, on all five levels, with no safety rails, makes any noisy app subtly dangerous.
Suggested fixes (any of these would help)
- Default
consolePiping.enabledtofalse. Opt-in for the debug case. - Dedup identical messages (same level + same string content) within e.g. a 1-second window — emit once, then a
[N more]summary. - Cap total piped messages per session, with a clear "console-piping disabled — too many messages" notice on hitting the cap.
- Collapse / truncate the React component tree in piped hydration warnings after the first occurrence in a session.
- (Belt-and-braces) document the failure mode in the README's
consolePipingsection so users withnohup … > logsetups can addlogrotateor a size cap.
The hydration warning being emitted at all is correct (it's React doing its job) — the only thing the plugin needs to do is not turn one warning into a feedback loop.
Environment
@tanstack/devtools-vite0.6.0@tanstack/react-start(latest at time of report)- React 19.2.5
- Vite 8.0.10
- macOS 25.4 / Node via pnpm 10.x
Workaround
Pass consolePiping: { enabled: false } to devtools():
plugins: [
devtools({ consolePiping: { enabled: false } }),
// ...
],
This stopped log growth completely. We still get the actual hydration warning in the browser console (which is what we want), but no server-side amplification.
- Ngôn ngữ chính
- TypeScript
- Star
- 514
- Fork
- 105
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của TanStack/devtools
-
Production stripping misses plugin factory imports, leaving unused Hotkeys font assetsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TanStack/devtools#562 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
TanStack/devtools#556 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
devtools-vite: four transform hooks have no filter, and inject-plugin parses pre-bundled dependency chunksCó thể đã có người làm @shkumbinhasani đã nhận 33 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 52/100
TanStack/devtools#534 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
TanStack/devtools#522 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/devtools
Issue tương tự
-
area:plugins kind:bug priority:p2 ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Escaped `*` followed by `*` (`\**`) never matchesCó thể đã có người làm @bardrop đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100
editorconfig/editorconfig-core-js#172 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
vega/vega-webgpu#40 ·
-
Adjust break point sizingĐang mởtype: bug 🐛
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
puckeditor/puck#1929 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
compression() compresses every response at Brotli quality 11Có thể đã có người làm @staylor đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày