Skip to content

fix: bring the console back: render its first screen in every build, and start without it - #191

Merged
ChristopherPHolder merged 2 commits into
mainfrom
f/console-boot-without-render
Nov 22, 2026
Merged

ChristopherPHolder merged 2 commits into
mainfrom
f/console-boot-without-render

Conversation

@ChristopherPHolder

@ChristopherPHolder ChristopherPHolder commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

The Console has been blank in production since 4b5d675 (#175). Two things went wrong together:

  1. The deploy didn't render the first screen. The render ran as a second command after vp build (vp build && node scripts/render-shell.ts). The deploy builds the Console through Alchemy's Cloudflare.Website.Vite, which runs its own vite build and never that second command, so production served a bare <div id="root">.
  2. The page couldn't start without it. The page always called Runtime.hydrate in a build, and Foldkit refuses to hydrate without server-rendered markup ("Runtime.hydrate could not find a server-rendered root stamped with data-foldkit-app"). Nothing started.

The fixes:

  • The page starts either way. It hydrates only when the rendered root ([data-foldkit-app]) is there, and starts fresh with Runtime.run otherwise.
  • Every build renders. A plugin in the Console's vite.config.ts runs the render at the end of the client build, so any vite build renders the first screen, the deploy's included. I checked this through Vite's createBuilder().buildApp(), the same API Alchemy drives.
  • No more stale index.html. The build is one command again. With two commands, Vite Task cached the render separately while ignoring dist/, so it could replay an index.html that pointed at scripts from an older build. That's what failed this PR's first CI run: it served index-DtZn22pp.js, the production build's script.

How I tested it

  • I loaded the live page in Chromium: blank, with the error above.
  • A new smoke test serves the built page with its rendered screen stripped back to <div id="root"></div>. It checks that the page still starts (Couldn't start outside Discord) with no errors.
  • The other smoke tests still check that the built page arrives rendered and that start-up takes the markup over.
  • vp run ci passes from a clean task cache.

Checklist

  • vp run ci passes
  • Tests cover the change
  • Docs updated if what gets posted, the configuration, the Console or the deploy changed (see CONTRIBUTING.md): CONTRIBUTING describes where the render runs now
  • New environment variables are wired through (none added)
  • Ready to ship: merging this deploys it to production. It fixes the blank Console.

…rst screen

The production deploy builds the Console through Alchemy's own vite
build, which doesn't run the step that renders the first screen into
index.html. The page then called Runtime.hydrate on an empty root, which
refuses to start, and the Console stayed blank. The page now hydrates
only when the rendered root is there and starts fresh otherwise, and
the smoke test serves it unrendered to keep it that way.
… the deploy's

The render ran as a second command after vp build, which Alchemy's
deploy never runs, so production served the page unrendered. It now
runs from a plugin at the end of the client build, so any vite build
renders it. The build is one command again, which also stops Vite
Task from replaying an index.html that pointed at scripts from an
older build.
@ChristopherPHolder ChristopherPHolder changed the title fix: start the console's page when it arrives without its rendered first screen fix: bring the console back: render its first screen in every build, and start without it Nov 22, 2026
@ChristopherPHolder
ChristopherPHolder merged commit 6bd4a2b into main Nov 22, 2026
3 checks passed
@ChristopherPHolder
ChristopherPHolder deleted the f/console-boot-without-render branch November 22, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant