Closed bug report

Generate hangs on server render: render view and studio tab fight over slotSize

Kyle Bergstedt · ·closed by Colby Knox

Generate hangs on "rendering on server" and never renders while the studio tab is open (hero-studio 0.20.9, macOS)

What happens: clicking Generate shows "rendering on server" indefinitely. render-hero.mjs times out after 30 s in page.goto(..., { waitUntil: 'networkidle2' }), so no PNG is written and _gen stays null.

Cause (measured): the headless ?render=1 page and the user's open studio tab both report slotSize, and they measure different sizes (render page 1118x1278 at 1680x1080 @2x, my tab 1114x1273). public/js/app.js posts send({ slotSize }) whenever the measured size differs from state.slotSize, the server broadcasts the new state over SSE, and the other client then posts its own size back. Sampling hero-studio state during a render shows slotSize flipping between the two values continuously. The render page made about 9,100 requests to /state in 12 s, so it never goes network-idle.

Repro: have a studio tab open at a viewport whose slot measures differently from 1680x1080 @2x, pose a page, click Generate. Or, while a tab is open, run node render-hero.mjs "http://127.0.0.1:8846/?render=1" out.png: exits at 30 s with a navigation timeout.

Fix (verified locally): don't report the slot from the render view. In public/js/app.js:

if ((cur.w !== w || cur.h !== h) && document.body.dataset.render !== '1') send({ slotSize: { w: w, h: h } });

With that one change the same manual render finished in 4 s, and the human Generate click produced the stamped hero (provenance chunk present) on the first try.

Possibly also worth it: render-hero.mjs could wait for #hero plus a fixed settle instead of networkidle2, since the studio page keeps an SSE stream and any future write loop would hang it the same way.

1 Reply

Colby Knox ·

Thanks Kyle, your diagnosis was exactly right. The fix for that loop shipped in 0.21.3 (2026-09-22): the render view (?render=1) is read-only, so it never posts state or opens the event stream, and each surface reports its slot only when its own measurement changes, not when it differs from the server's. You're on 0.20.9, so adom-wiki pkg update adom/hero-studio fixes this case.

Your second suggestion is in 0.23.4: render-hero.mjs no longer waits for networkidle2. The render view marks itself rendered after its first paint, and the renderer waits for that mark, loaded fonts and complete images. A page that keeps any request going can no longer hang Generate.

Checked with a second studio tab open at a different viewport during a render: the render finished in 9 s, the tab posted its slot once, and the PNG came out complete.

Colby Knox closed this ·

Log in to reply.