Repository navigation
fix: bring the console back: render its first screen in every build, and start without it - #191
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The Console has been blank in production since 4b5d675 (#175). Two things went wrong together:
vp build(vp build && node scripts/render-shell.ts). The deploy builds the Console through Alchemy'sCloudflare.Website.Vite, which runs its ownvite buildand never that second command, so production served a bare<div id="root">.Runtime.hydratein 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:
[data-foldkit-app]) is there, and starts fresh withRuntime.runotherwise.vite.config.tsruns the render at the end of the client build, so anyvite buildrenders the first screen, the deploy's included. I checked this through Vite'screateBuilder().buildApp(), the same API Alchemy drives.index.html. The build is one command again. With two commands, Vite Task cached the render separately while ignoringdist/, so it could replay anindex.htmlthat pointed at scripts from an older build. That's what failed this PR's first CI run: it servedindex-DtZn22pp.js, the production build's script.How I tested it
<div id="root"></div>. It checks that the page still starts (Couldn't startoutside Discord) with no errors.vp run cipasses from a clean task cache.Checklist
vp run cipasses