Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Charts never render with Reflex 0.10: the /_xy namespace socket is never connected

Chiusa Adatta ai principianti
#526 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@masenf ci sta già lavorando.

Dal 13/10/2026.

  • #527 di @masenf — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript, python, react
Ambito
backend, frontend

Direzione di ricerca

Inizia da XYChart.jsx e segui come xySocket() crea o riutilizza il socket del namespace Socket.IO insieme a createSocket di Reflex in reflex_base/.templates/web/utils/state.js. Controlla il comportamento di connessione di socket.io-client descritto nell’issue, poi riproducilo con Reflex 0.10. Il lavoro è completo quando il namespace si connette e i grafici vengono visualizzati con un canvas; verifica che il comportamento esistente con Reflex 0.9.13 rimanga intatto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

With Reflex 0.10.0, every xy chart in a Reflex app renders empty: the chart's wrapper div mounts, the figure token arrives in state, but no canvas is ever created. Reflex 0.9.13 with the same app and xy[reflex]==0.0.7 renders normally.

Root cause

Reflex 0.10 creates its Socket.IO socket ahead of time with autoConnect: false (reflex_base/.templates/web/utils/state.js, createSocket, used for the "warm socket"). None of 0.9.8 to 0.9.13 does that.

XYChart.jsx's xySocket() deliberately shares Reflex's manager (same URL and path, so io() returns a namespace socket on the cached Manager). A namespace socket only opens itself when the manager was created with autoConnect on (if (this.io._autoConnect) this.open() in socket.io-client's Socket constructor). Because Reflex now creates the manager first with autoConnect: false, the /_xy namespace socket is never connected:

  • no 40/_xy CONNECT packet ever goes out on the websocket;
  • with localStorage.xy_debug = "1", the effect logs effect run {... hasEl: true} for every chart, but never xy namespace connected nor xy connect_error;
  • every sub emit is buffered forever, so no figure payload arrives.

Reproduction

  1. A Reflex app using reflex_xy.XYPlugin() and any live chart (figure= handle).
  2. reflex==0.10.0, xy[reflex]==0.0.7, Chrome.
  3. Open a page with a chart: the container is empty and document.querySelectorAll("canvas").length === 0.
  4. Downgrade to reflex==0.9.13: the charts render.

Suggested fix

Connect the namespace explicitly instead of relying on the shared manager's autoConnect, e.g. in xySocket():

sharedSocket = io(nsUrl.href, { /* unchanged options */ });
sharedSocket.on("connect", () => dbg("xy namespace connected"));
sharedSocket.on("connect_error", (e) => dbg("xy connect_error", String(e)));
if (!sharedSocket.connected) sharedSocket.connect();
return sharedSocket;

connect() is a no-op on an already-active socket, so this is safe whichever side creates the manager first.

Lingua principale
Python
Stelle
1.9k
Fork
76
Merge medio
36m
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di reflex-dev/xy

Tutte le issue di reflex-dev/xy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.