René's URL Explorer Experiment


Title: devtools-vite console pipe: infinite feedback loop with Vite 8 `server.forwardConsole` — one console entry floods browser + terminal · Issue #482 · TanStack/devtools · GitHub

Open Graph Title: devtools-vite console pipe: infinite feedback loop with Vite 8 `server.forwardConsole` — one console entry floods browser + terminal · Issue #482 · TanStack/devtools

X Title: devtools-vite console pipe: infinite feedback loop with Vite 8 `server.forwardConsole` — one console entry floods browser + terminal · Issue #482 · TanStack/devtools

Description: Which project does this relate to? Devtools Describe the bug @tanstack/devtools-vite's console pipe enters an infinite feedback loop with Vite 8's server.forwardConsole (on by default): a single console.error/console.warn anywhere — clie...

Open Graph Description: Which project does this relate to? Devtools Describe the bug @tanstack/devtools-vite's console pipe enters an infinite feedback loop with Vite 8's server.forwardConsole (on by default): a single co...

X Description: Which project does this relate to? Devtools Describe the bug @tanstack/devtools-vite's console pipe enters an infinite feedback loop with Vite 8's server.forwardConsole (on by default): a s...

Opengraph URL: https://github.com/TanStack/devtools/issues/482

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"devtools-vite console pipe: infinite feedback loop with Vite 8 `server.forwardConsole` — one console entry floods browser + terminal","articleBody":"### Which project does this relate to?\n\nDevtools\n\n### Describe the bug\n\n`@tanstack/devtools-vite`'s console pipe enters an **infinite feedback loop** with Vite 8's `server.forwardConsole` (on by default): a single `console.error`/`console.warn` anywhere — client or server — floods both the browser console and the terminal with thousands of nested lines per minute, indefinitely:\n\n```\n9:27:59 PM [vite] (client) [console.error] [Server] 9:27:59 PM [vite] (client) [console.error] [Server] 9:27:59 PM [vite] (client) [console.error] [Se…\n```\n\n**The cycle:**\n\n1. Any console entry in the browser → Vite 8 `forwardConsole` re-prints it in the terminal via the server logger (`… [vite] (client) [console.error] …`).\n2. The console-pipe's **server-side** console patch intercepts that print. Its recursion guard only skips messages containing `[TSD Console Pipe]` / `[@tanstack/devtools`, so a Vite-forwarded *client* log is treated as a server log and broadcast to the browser over SSE.\n3. The browser mirror prints it (`%c[Server]%c …`) → Vite forwards it again → goto 1. Each hop nests the previous message inside itself.\n\nIn a real TanStack Start app (Vite 8.0.16, devtools-vite 0.8.1) we measured **one** failed fetch turning into 37,779 browser console entries in 30s and a 2.5 GB terminal log in about a minute.\n\nThe related fix in 0.6.1 (\"console pipe feedback loop … with Vite 8\") does not cover this path — 0.7.0 and 0.8.1 both reproduce.\n\n### Your Example Website or App\n\nSee minimal reproduction below (4 files)\n\n### Steps to Reproduce the Bug or Issue\n\n**package.json**\n```json\n{\n  \"name\": \"tsd-console-loop-repro\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"scripts\": { \"dev\": \"vite\" },\n  \"devDependencies\": {\n    \"@tanstack/devtools-vite\": \"0.8.1\",\n    \"vite\": \"8.0.16\"\n  }\n}\n```\n\n**vite.config.js** — bare Vite + devtools + a 10-line SSR middleware (the pipe's server console patch is only injected into SSR modules, so a plain SPA doesn't show it):\n```js\nimport { devtools } from '@tanstack/devtools-vite'\n\nexport default {\n  appType: 'custom',\n  plugins: [\n    devtools(),\n    {\n      name: 'mini-ssr',\n      configureServer(server) {\n        return () => {\n          server.middlewares.use(async (req, res) => {\n            const { render } = await server.ssrLoadModule('/entry-server.js')\n            res.setHeader('content-type', 'text/html')\n            res.end(await server.transformIndexHtml(req.url ?? '/', render()))\n          })\n        }\n      },\n    },\n  ],\n}\n```\n\n**entry-server.js** — the `\u003chtml` marker makes the console-pipe transform patch the server console here:\n```js\nexport function render() {\n  return '\u003chtml>\u003cbody>\u003ch1>tsd console loop repro\u003c/h1>\u003cscript type=\"module\" src=\"/main.js\">\u003c/script>\u003c/body>\u003c/html>'\n}\n```\n\n**main.js** — the `createRoot` marker mimics a real client entry (which is what the client-side pipe injection keys on):\n```js\nfunction createRoot(el) {\n  el.textContent = 'mounted'\n}\ncreateRoot(document.querySelector('h1'))\n\n// A single console entry seeds the infinite echo.\nconsole.error('seed')\n```\n\nThen:\n1. `pnpm install && pnpm dev`\n2. Open the page in a browser.\n3. Watch the terminal and the browser console.\n\nMeasured on this repro (Playwright counting console messages, no interaction after load):\n\n| | 10s | 20s | 30s |\n|---|---|---|---|\n| browser console entries | 189 | 374 | 559 |\n\n…growing without bound; the dev-server terminal shows the same nested `[vite] (client) [console.error] [Server]` lines.\n\n### Expected behavior\n\nOne `console.error('seed')` produces one line in the browser and (via Vite's forwarding) one line in the terminal. Vite-forwarded client logs should not be re-broadcast to the browser as server logs.\n\n### Screenshots or Videos\n\n_No response_\n\n### Platform\n\n- OS: macOS 15 (Darwin 25.4.0)\n- Node: 22.20.0\n- vite: 8.0.16 (`server.forwardConsole` default-enabled)\n- @tanstack/devtools-vite: 0.8.1 (also reproduces on 0.7.0)\n\n### Additional context\n\nWe're currently carrying this as a `pnpm patch` — extending the recursion guard in the generated console-pipe code so the server-side patch skips Vite-forwarded client logs:\n\n```diff\n         // Skip our own TSD Console Pipe logs to avoid recursion/noise\n         if (args.length > 0 && typeof args[0] === 'string' &&\n             (args[0].indexOf('[TSD Console Pipe]') !== -1 ||\n              args[0].indexOf('[@tanstack/devtools') !== -1)) {\n           return;\n         }\n+\n+        // Vite 8's server.forwardConsole re-prints CLIENT console output in\n+        // the terminal (\"[vite] (client) [console.warn] ...\"). Those are not\n+        // server logs — re-broadcasting them to the browser makes the browser\n+        // log them again, which vite forwards again: an infinite\n+        // client->server->client echo. Skip vite-forwarded client logs.\n+        if (isServer && args.length > 0 && typeof args[0] === 'string' &&\n+            (args[0].indexOf('(client)') !== -1 ||\n+             args[0].indexOf('[console.') !== -1)) {\n+          return;\n+        }\n```\n\nWith that guard in place: same app, same seed error — browser console stays at 5 entries (flat), terminal stays quiet, and genuine server logs still mirror into the browser once, as intended. A marker-based handshake between the pipe and Vite's forwarder would probably be more robust than string matching, but the diff above demonstrates the loop and the fix.\n","author":{"url":"https://github.com/rshelnutt","@type":"Person","name":"rshelnutt"},"datePublished":"2026-07-08T01:29:21Z","url":"https://github.com/TanStack/devtools/issues/482"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e02935e6-69c0-5f92-1444-417719ec7c29
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC14A:3E915:180C58:21D7C4:6AF9A149
html-safe-nonce0f8edfe3515041ae53761c6ea59f1bc01816190e3f56eb602e9336d51ff3c7b6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTRBOjNFOTE1OjE4MEM1ODoyMUQ3QzQ6NkFGOUExNDkiLCJ2aXNpdG9yX2lkIjoiNTkyMzE3Njg3NDU1NjU0MjE3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac75e629ec07c4304715c5ada625403baab17200a784f83092d9c768b1e4e3ab43
hovercard-subject-tagissue:4833526249
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TanStack/devtools/482/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0298c8d299d10c44d967b88fdeb74158b63840b2d3bc1e14152ce979d9f1e1cd/TanStack/devtools/issues/482
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0298c8d299d10c44d967b88fdeb74158b63840b2d3bc1e14152ce979d9f1e1cd/TanStack/devtools/issues/482
og:image:altWhich project does this relate to? Devtools Describe the bug @tanstack/devtools-vite's console pipe enters an infinite feedback loop with Vite 8's server.forwardConsole (on by default): a single co...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamershelnutt
hostnamegithub.com
expected-hostnamegithub.com
None612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7
turbo-cache-controlno-preview
go-importgithub.com/TanStack/devtools git https://github.com/TanStack/devtools.git
octolytics-dimension-user_id72518640
octolytics-dimension-user_loginTanStack
octolytics-dimension-repository_id1026402761
octolytics-dimension-repository_nwoTanStack/devtools
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1026402761
octolytics-dimension-repository_network_root_nwoTanStack/devtools
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release072e34035c13c31543fba9f025cbbbda4210dae4
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/TanStack/devtools/issues/482#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTanStack%2Fdevtools%2Fissues%2F482
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTanStack%2Fdevtools%2Fissues%2F482
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=TanStack%2Fdevtools
Reloadhttps://github.com/TanStack/devtools/issues/482
Reloadhttps://github.com/TanStack/devtools/issues/482
Reloadhttps://github.com/TanStack/devtools/issues/482
TanStackhttps://github.com/TanStack
devtoolshttps://github.com/TanStack/devtools
Codehttps://github.com/TanStack/devtools
Issues24 (24)https://github.com/TanStack/devtools/issues
Pull requests25 (25)https://github.com/TanStack/devtools/pulls
Discussionshttps://github.com/TanStack/devtools/discussions
Actionshttps://github.com/TanStack/devtools/actions
Security and qualityhttps://github.com/TanStack/devtools/security
Insightshttps://github.com/TanStack/devtools/pulse
https://github.com/TanStack/devtools
New issuehttps://github.com/login?return_to=https://github.com/TanStack/devtools/issues/482
New issuehttps://github.com/login?return_to=https://github.com/TanStack/devtools/issues/482
#540https://github.com/TanStack/devtools/pull/540
devtools-vite console pipe: infinite feedback loop with Vite 8 server.forwardConsole — one console entry floods browser + terminalhttps://github.com/TanStack/devtools/issues/482#top
#540https://github.com/TanStack/devtools/pull/540
https://github.com/rshelnutt
rshelnutthttps://github.com/rshelnutt
on Jul 8, 2026https://github.com/TanStack/devtools/issues/482#issue-4833526249
https://github.com/samuelstroschein
samuelstroscheinhttps://github.com/samuelstroschein
on Aug 13, 2026https://github.com/TanStack/devtools/issues/482#issuecomment-5286490301
opral/paraglide-js#739https://github.com/opral/paraglide-js/issues/739
TanStack/cli#503https://github.com/TanStack/cli/pull/503
https://github.com/schiller-manuel
schiller-manuelhttps://github.com/schiller-manuel
on Aug 13, 2026https://github.com/TanStack/devtools/issues/482#issuecomment-5287285200
https://github.com/samuelstroschein
samuelstroscheinhttps://github.com/samuelstroschein
on Aug 14, 2026https://github.com/TanStack/devtools/issues/482#issuecomment-5287881582
https://github.com/samuelstroschein/tanstack-devtools-vite-console-loop-reprohttps://github.com/samuelstroschein/tanstack-devtools-vite-console-loop-repro
AlemTuzlakhttps://github.com/AlemTuzlak
completedhttps://github.com/TanStack/devtools/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#540https://github.com/TanStack/devtools/pull/540
on Oct 29, 2026https://github.com/TanStack/devtools/issues/482#event-34601738545
thedv91https://github.com/thedv91
on Oct 29, 2026https://github.com/TanStack/devtools/issues/482#event-34612613376
fix(devtools-bundler-core): do not pipe Vite-forwarded browser logs b…https://github.com/thedv91/devtools/commit/012421fcc31b6d4284fdc6083af2b773246469be
https://docs.github.com/articles/closing-issues-via-commit-messages
012421fhttps://github.com/thedv91/devtools/commit/012421fcc31b6d4284fdc6083af2b773246469be
Sign up for freehttps://github.com/signup?return_to=https://github.com/TanStack/devtools/issues/482
Sign in to commenthttps://github.com/login?return_to=https://github.com/TanStack/devtools/issues/482
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.