Title: Bundler-injected defaults override explicit `ClientEventBus` config · Issue #499 · TanStack/devtools · GitHub
Open Graph Title: Bundler-injected defaults override explicit `ClientEventBus` config · Issue #499 · TanStack/devtools
X Title: Bundler-injected defaults override explicit `ClientEventBus` config · Issue #499 · TanStack/devtools
Description: TanStack Devtools version @tanstack/devtools-event-bus: 0.4.2 | @tanstack/devtools-vite: 0.8.3 Framework/Library version @tanstack/svelte-devtools: 0.1.3 Describe the bug and the steps to reproduce it ClientEventBus accepts explicit port...
Open Graph Description: TanStack Devtools version @tanstack/devtools-event-bus: 0.4.2 | @tanstack/devtools-vite: 0.8.3 Framework/Library version @tanstack/svelte-devtools: 0.1.3 Describe the bug and the steps to reproduce...
X Description: TanStack Devtools version @tanstack/devtools-event-bus: 0.4.2 | @tanstack/devtools-vite: 0.8.3 Framework/Library version @tanstack/svelte-devtools: 0.1.3 Describe the bug and the steps to reproduce...
Opengraph URL: https://github.com/TanStack/devtools/issues/499
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bundler-injected defaults override explicit `ClientEventBus` config","articleBody":"### TanStack Devtools version\n\n@tanstack/devtools-event-bus: 0.4.2 | @tanstack/devtools-vite: 0.8.3\n\n### Framework/Library version\n\n@tanstack/svelte-devtools: 0.1.3\n\n### Describe the bug and the steps to reproduce it\n\n`ClientEventBus` accepts explicit `port`, `host`, and `protocol` options, but a Vite or Rspack connection transform can override them. The constructor passes each explicit option through `getDefault*()` after destructuring [client.ts#L91-L105](https://github.com/TanStack/devtools/blob/53805408af7e6010e209f21a073204411bc1267f/packages/event-bus/src/client/client.ts#L91-L105).\n\nThe Vite connection-injection plugin replaces every `__TANSTACK_DEVTOOLS_*__` placeholder with the bundler's connection value [plugin.ts#L576-L608](https://github.com/TanStack/devtools/blob/53805408af7e6010e209f21a073204411bc1267f/packages/devtools-vite/src/plugin.ts#L576-L608). After that transform, each `getDefault*()` helper always returns the injected value, even when the caller supplied a different runtime value. For example, `new ClientEventBus({ host: 'devtools.example.com', port: 443, protocol: 'https' })` can still connect to the injected `localhost` HTTP endpoint.\n\nThis prevents applications behind a development proxy from directing the browser event bus through the public HTTPS origin. The client instead attempts to connect to the bundler's internal host, port, and protocol.\n\n### Expected behavior\n\nExplicit `ClientEventBus` options should take precedence over bundler-injected defaults. Bundler-injected values should apply when an option is omitted, and the built-in `localhost:4206` HTTP values should remain the final fallback.\n\nThe constructor can preserve that precedence by resolving each injected default in the parameter default and assigning an explicitly supplied value directly.\n\n### Your Minimal, Reproducible Example - (Sandbox Highly Recommended)\n\nhttps://stackblitz.com/edit/vitejs-vite-nz7smy9p?file=package.json,index.html,vite.config.ts,src%2Fmain.ts\n\n### Do you intend to try to help solve this bug with your own PR?\n\nYes, I am also opening a PR that solves the problem along side 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.","author":{"url":"https://github.com/kolaworld","@type":"Person","name":"kolaworld"},"datePublished":"2026-08-15T22:13:53Z","url":"https://github.com/TanStack/devtools/issues/499"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d90adcd3-2d6e-0ebc-d0c6-5a98b1ffdc5f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E24:23B0E1:40EE8:5BCA1:6AF9BC56 |
| html-safe-nonce | 5562917fdefa3b2f99cb2cf59369a25ddca9aa3a973f1b46a70c9f9266feb4c7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTI0OjIzQjBFMTo0MEVFODo1QkNBMTo2QUY5QkM1NiIsInZpc2l0b3JfaWQiOiIyMDIxMzk4MTE1OTUyMjEzMDc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5029a41df7478ea8d13f08dbd11d599245603d5056b79d29deaef5005e0d8b45 |
| hovercard-subject-tag | issue:5161558372 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/TanStack/devtools/499/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e48fce5ce3d2402e3e7eea2b5c5781f6f2071415d7ebdf06aa76a73e7bd5a07e/TanStack/devtools/issues/499 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e48fce5ce3d2402e3e7eea2b5c5781f6f2071415d7ebdf06aa76a73e7bd5a07e/TanStack/devtools/issues/499 |
| og:image:alt | TanStack Devtools version @tanstack/devtools-event-bus: 0.4.2 | @tanstack/devtools-vite: 0.8.3 Framework/Library version @tanstack/svelte-devtools: 0.1.3 Describe the bug and the steps to reproduce... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kolaworld |
| hostname | github.com |
| expected-hostname | github.com |
| None | 612d3e6ffd693e7ea8d9fcf452370995872baef31d825b1fedef704cd3d24ac7 |
| turbo-cache-control | no-preview |
| go-import | github.com/TanStack/devtools git https://github.com/TanStack/devtools.git |
| octolytics-dimension-user_id | 72518640 |
| octolytics-dimension-user_login | TanStack |
| octolytics-dimension-repository_id | 1026402761 |
| octolytics-dimension-repository_nwo | TanStack/devtools |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1026402761 |
| octolytics-dimension-repository_network_root_nwo | TanStack/devtools |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 072e34035c13c31543fba9f025cbbbda4210dae4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width