René's URL Explorer Experiment


Title: Pre-bundled client ignores the event bus port from devtools-vite · Issue #536 · TanStack/devtools · GitHub

Open Graph Title: Pre-bundled client ignores the event bus port from devtools-vite · Issue #536 · TanStack/devtools

X Title: Pre-bundled client ignores the event bus port from devtools-vite · Issue #536 · TanStack/devtools

Description: TanStack Devtools version @tanstack/react-devtools 0.10.13, @tanstack/devtools-vite 0.8.5 Framework/Library version React 19.3.0, Vite 8.3.1 Describe the bug and the steps to reproduce it In the browser, the event bus client always uses ...

Open Graph Description: TanStack Devtools version @tanstack/react-devtools 0.10.13, @tanstack/devtools-vite 0.8.5 Framework/Library version React 19.3.0, Vite 8.3.1 Describe the bug and the steps to reproduce it In the br...

X Description: TanStack Devtools version @tanstack/react-devtools 0.10.13, @tanstack/devtools-vite 0.8.5 Framework/Library version React 19.3.0, Vite 8.3.1 Describe the bug and the steps to reproduce it In the br...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Pre-bundled client ignores the event bus port from devtools-vite","articleBody":"### TanStack Devtools version\n\n@tanstack/react-devtools 0.10.13, @tanstack/devtools-vite 0.8.5\n\n### Framework/Library version\n\nReact 19.3.0, Vite 8.3.1\n\n### Describe the bug and the steps to reproduce it\n\nIn the browser, the event bus client always uses port 4206, even when `devtools-vite` runs the server bus on another port. So `eventBusConfig.port` in `devtools()` has no effect in the browser. The `EADDRINUSE` fallback fails the same way. When another dev server holds 4206, the plugin moves its own bus to a random port. The browser still dials 4206.\n\n**Cause**\n\nThe `@tanstack/devtools:connection-injection` transform replaces `__TANSTACK_DEVTOOLS_PORT__` only in modules whose id contains `@tanstack/devtools` or `@tanstack/event-bus`. Vite pre-bundles `@tanstack/react-devtools` and serves the bus client from a chunk such as `/node_modules/.vite/deps/BRS44MK7-KeTQTbh5.js`. That id matches neither filter, so the placeholder stays, and `getDefaultPort(4206)` returns 4206.\n\nThe examples in this repository link the packages with `workspace:*`, and Vite does not pre-bundle linked packages.\n\n**Reproduction**\n\n`package.json` dependencies:\n\n```json\n\"@tanstack/devtools-vite\": \"0.8.5\",\n\"@tanstack/react-devtools\": \"0.10.13\",\n\"@vitejs/plugin-react\": \"6.1.1\",\n\"react\": \"19.3.0\",\n\"react-dom\": \"19.3.0\",\n\"vite\": \"8.3.1\"\n```\n\n`vite.config.ts`:\n\n```ts\nimport { devtools } from '@tanstack/devtools-vite'\nimport react from '@vitejs/plugin-react'\nimport { defineConfig } from 'vite'\n\nexport default defineConfig({\n  plugins: [devtools({ eventBusConfig: { port: 4260, debug: true } }), react()],\n})\n```\n\n`src/main.tsx`, loaded from a plain `index.html`:\n\n```tsx\nimport { TanStackDevtools } from '@tanstack/react-devtools'\nimport { createRoot } from 'react-dom/client'\n\ncreateRoot(document.getElementById('root')!).render(\n  \u003cTanStackDevtools eventBusConfig={{ connectToServerBus: true, debug: true }} />,\n)\n```\n\n1. Run `vite --port 3160`. The server bus starts on the configured port:\n\n   ```\n   🌴 [tanstack-devtools:server-bus]  Listening on http://localhost:4260\n   ```\n\n2. Open http://localhost:3160/. The client fails to connect, and the server bus logs no client:\n\n   ```\n   [Client] 🌴 [tanstack-devtools:client-bus] Connecting to WebSocket server\n   [Client] 🌴 [tanstack-devtools:client-bus] WebSocket connection error\n   ```\n\n3. Fetch the served chunk that contains the bus client, for example `curl -s 'http://localhost:3160/node_modules/.vite/deps/BRS44MK7-KeTQTbh5.js'`. The placeholder is still there:\n\n   ```js\n   function getDefaultPort(configPort) {\n   \tif (typeof __TANSTACK_DEVTOOLS_PORT__ !== \"undefined\") return __TANSTACK_DEVTOOLS_PORT__;\n   \treturn configPort;\n   }\n   ```\n\nAs a control, add `optimizeDeps: { exclude: ['@tanstack/react-devtools'] }`. The server bus then logs `New WebSocket client connected`, and the client logs `WebSocket connection opened`. This exclusion is not a usable workaround, because it breaks the `dayjs` default import (#423).\n\n**Expected behavior**\n\nThe browser client connects to the port the server bus listens on, including the `EADDRINUSE` fallback port.\n\n**Workaround**\n\nPass the same fixed port to both sides: `devtools({ eventBusConfig: { port } })` and `\u003cTanStackDevtools eventBusConfig={{ port }} />`. This fails again when that port is taken.\n\n**Possible fix**\n\nAlso match ids under `/node_modules/.vite/deps/` in `connection-injection`. The placeholder check already limits the transform to modules that contain the placeholders.\n\n**Environment:** macOS (Darwin 25.6.0), Bun 1.4.2, Node 26.10.0, Chrome.\n\n### Your Minimal, Reproducible Example - (Sandbox Highly Recommended)\n\nThe complete reproduction is inline above: four files and three steps.\n\n### Do you intend to try to help solve this bug with your own PR?\n\nYes, I think I know how to fix it and will discuss it in the comments of this issue\n\n### Terms & Code of Conduct\n\n- [x] I agree to follow this project's Code of Conduct\n- [x] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.\n","author":{"url":"https://github.com/svyatov","@type":"Person","name":"svyatov"},"datePublished":"2026-09-30T21:13:43Z","url":"https://github.com/TanStack/devtools/issues/536"}

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:cd6a9b33-3576-082c-291d-a04a8fee38b6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8582:1B5107:19E2CC6:2388860:6AF9AC4F
html-safe-noncefe1c39285c46504a5910fcc774e385cd56881f81645898b43bb4a8b7c99b35f2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTgyOjFCNTEwNzoxOUUyQ0M2OjIzODg4NjA6NkFGOUFDNEYiLCJ2aXNpdG9yX2lkIjoiNTcyNzA5MzYzOTc4ODIxMTI4MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac518fa46f030b755f9fd3ac01a5b842b46192504ad873aee5f0ef0e8035582b3d
hovercard-subject-tagissue:5653117096
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/536/issue_layout
twitter:imagehttps://opengraph.githubassets.com/484961038e7144e08ed37dd7b94dd05990b4be747875b8c7f7f25c0314dcb7b8/TanStack/devtools/issues/536
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/484961038e7144e08ed37dd7b94dd05990b4be747875b8c7f7f25c0314dcb7b8/TanStack/devtools/issues/536
og:image:altTanStack Devtools version @tanstack/react-devtools 0.10.13, @tanstack/devtools-vite 0.8.5 Framework/Library version React 19.3.0, Vite 8.3.1 Describe the bug and the steps to reproduce it In the br...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesvyatov
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/536#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FTanStack%2Fdevtools%2Fissues%2F536
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%2F536
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/536
Reloadhttps://github.com/TanStack/devtools/issues/536
Reloadhttps://github.com/TanStack/devtools/issues/536
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/536
New issuehttps://github.com/login?return_to=https://github.com/TanStack/devtools/issues/536
#538https://github.com/TanStack/devtools/pull/538
Pre-bundled client ignores the event bus port from devtools-vitehttps://github.com/TanStack/devtools/issues/536#top
#538https://github.com/TanStack/devtools/pull/538
https://github.com/svyatov
svyatovhttps://github.com/svyatov
on Sep 30, 2026https://github.com/TanStack/devtools/issues/536#issue-5653117096
http://localhost:3160/http://localhost:3160/
#423https://github.com/TanStack/devtools/issues/423
AlemTuzlakhttps://github.com/AlemTuzlak
completedhttps://github.com/TanStack/devtools/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#538https://github.com/TanStack/devtools/pull/538
on Oct 29, 2026https://github.com/TanStack/devtools/issues/536#event-34601156733
thedv91https://github.com/thedv91
on Oct 29, 2026https://github.com/TanStack/devtools/issues/536#event-34612612625
fix(devtools-vite): inject the bus port into pre-bundled dependency c…https://github.com/thedv91/devtools/commit/7cb0a8d4ceeb314c4a6e5cb9bd7b3162ba7bfcf5
https://docs.github.com/articles/closing-issues-via-commit-messages
7cb0a8dhttps://github.com/thedv91/devtools/commit/7cb0a8d4ceeb314c4a6e5cb9bd7b3162ba7bfcf5
Sign up for freehttps://github.com/signup?return_to=https://github.com/TanStack/devtools/issues/536
Sign in to commenthttps://github.com/login?return_to=https://github.com/TanStack/devtools/issues/536
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.