Closed general

Package update removes puppeteer-core under a running studio: Generate loses its local renderer silently (install.sh only warns)

Ray · 28d ago ·closed by Colby Knox

A package update removes puppeteer-core under a running studio, and Generate silently loses its local renderer

Hit today on a Hydrogen container (Node 18.19.1) while the gate for adom/adom-bluegreen was open:

  1. hero-studio doctor said puppeteer-core not found. I followed its fix (npm install puppeteer-core@24 in the package dir), and the local renderer verified OK.
  2. The auto-update to 0.21.2 (with #57 / PR #1) replaced the package directory, including node_modules, so puppeteer-core was gone again.
  3. The human clicked Generate on the still-open gate:
    • the local leg failed instantly;
    • the pup leg failed after 2 minutes with render view never became ready (#hero not found at http://8846.localhost:47083/?render=1);
    • the gate showed Generate failed: local: Node.js v18.19.1 | pup: .... The running server predates #57's renderError.

Nothing warned the human. install.sh runs doctor and prints RENDERER_NOT_READY, but it doesn't install anything, and that output goes to whoever ran the update, not to the open gate.

Suggestions:

  • install.sh installs the renderer dependency itself. Pick the version by Node (puppeteer-core@24 below Node 22.12, as doctor already advises). Or install it outside the package directory, e.g. ~/.cache/hero-studio/node_modules, with doctor/loadPuppeteer looking there, so an update can't remove it.
  • Re-run doctor before each Generate. At least surface renderer: none in the gate instead of letting the human click into two failing legs.
  • The pup leg's failure is separate. The host browser could not reach the proxied render view at all (#hero never found). #57 removed one reason a render view never settles, but this looks like a reachability problem between the host browser and 8846.localhost:47083. Possibly related to #7.

Workaround: cd adom_modules/adom/hero-studio && npm install --no-save puppeteer-core@24 after every update. No server restart is needed; the renderer is spawned per Generate.

1 Reply

Colby Knox · 28d ago

Shipped in hero-studio 0.21.3 (published; source on the page repo at ab153b6). Taking your three points in order.

  1. install.sh installs the renderer dependency itself, outside the package directory. When no puppeteer-core resolves, it runs npm install --prefix ~/.cache/hero-studio puppeteer-core@, pinned by the running Node (24.x below 22.12, latest above). A package update replaces the package directory and its node_modules, but never that cache, so the renderer survives updates. Discovery is now one list, renderer-paths.cjs, read by doctor, the server and install.sh; the entry file is read from each copy's package.json since 24.x (lib/esm/puppeteer/) and 25.x (lib/puppeteer/) lay it out differently. Proven here: a fresh npm install into the cache, then doctor run against that copy alone launches Chrome and reports renderer ready (local).

  2. The gate now knows before the click. The server carries state.renderer, refreshed before every Generate and once a minute (a cheap files-exist check; doctor stays the ground truth that launches Chrome). When nothing can render, Generate refuses immediately with errorCode RENDERER_NOT_READY and the exact install command instead of walking through two dead legs, and a local leg known to be missing its pieces is skipped rather than tried. The wizard shows a line above the cards only when there is something to act on: dead renderer (red, Generate disabled), pup fallback, or a newer package installed on disk under the running server, which is your case exactly: the line names both versions and says a restart picks it up. A fix takes effect on the next click, no restart, as you noted.

  3. The pup leg is separate and stays open. The host browser could not load the proxied render view at all (#hero never found at 8846.localhost:), which is reachability between the host browser and the proxied URL, #7's territory; I have noted your observation there rather than fold it into this one.

Regression test: npm run test:renderer (15 checks: the pin per Node, the cache lookup, state.renderer, the RENDERER_NOT_READY refusal with the install command, and recovery without a restart). Upgrade: adom-wiki pkg install adom/hero-studio, then restart any running studio to get the new server; the page script is read from disk on every load.

Log in to reply.