Devtools events lost when using Nitro v3 (worker_threads isolates globalThis)
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- typescript, vite
- Domínio
- backend-api-design, devtools
Direção de pesquisa
Comece rastreando EventClient e ServerEventBus em torno de globalThis.TANSTACK_EVENT_TARGET e, em seguida, reproduza o problema com o plugin Vite nitro() e a configuração Nitro v3 worker_threads descrita na issue. Compare os limites entre o worker e a thread principal do Vite e verifique se os eventos do Devtools no lado do servidor chegam ao painel sem o workaround HTTP.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
TanStack Devtools version
0.9.13
Framework/Library version
TanStack Start v1.149.3, Nitro v3.0.1-nightly
Describe the bug and the steps to reproduce it
When using TanStack Start with the nitro() Vite plugin (Nitro v3 nightly) rather than nitroV2Plugin, devtools events emitted from server code never reach the devtools panel.
The root cause is that Nitro v3's NodeEnvRunner runs server code in a worker_threads Worker during dev. EventClient dispatches events to globalThis.__TANSTACK_EVENT_TARGET__
inside the worker thread, but ServerEventBus is listening on a different globalThis.__TANSTACK_EVENT_TARGET__ in the Vite main thread. The events are emitted but never received.
This doesn't happen with nitroV2Plugin because that plugin is build-only — in dev, Start uses its own RunnableDevEnvironment which runs in-process and shares the same global scope.
Steps to reproduce:
- Set up a TanStack Start app using
nitro()(Nitro v3) instead ofnitroV2Plugin - Emit devtools events from server code (e.g. TanStack AI streaming, or any library using
@tanstack/devtools-event-client) - Open the devtools panel — server-side events are missing
Workaround:
We confirmed the issue by manually bridging events from the Nitro worker to the Vite process over HTTP — intercepting tanstack-dispatch-event on the worker's
globalThis.__TANSTACK_EVENT_TARGET__ and POSTing the payload to a Vite dev server middleware that re-dispatches it on the main thread's event target. This works but is hacky.
Apologies for the double-post — originally mentioned this in Discord, just filing here too since it might be easier to track.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
n/a
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- 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.
- Linguagem predominante
- TypeScript
- Estrelas
- 500
- Forks
- 100
- Merge médio
- 1d 8h
- PRs com merge (30d)
- 4
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TanStack/devtools
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 76/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 52/100
Todas as issues de TanStack/devtools
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
siyuan-note/siyuan#20040 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
RunestoneInteractive/rs#1574 ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
remotion-dev/remotion#11901 ·
Mantenedores costumam responder em até 1 dia
-
Poll constructor throws for an uncached channel while resolving a message context-menu interactionAbertabug need repro packages:discord.js
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
discordjs/discord.js#11645 ·
Mantenedores costumam responder em até 3 dias
-
🐞 bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Sitecore/content-sdk#641 ·
Mantenedores costumam responder em até 2 dias