fix(ui): apps/loopover-ui's vite preview is broken for the Cloudflare Workers build target#7625
Conversation
apps/loopover-ui's preview script (vite preview) 500s on every request after any build: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../dist/server/server.js'. Reproduced directly on main. vite.config.ts pins nitro's cloudflare-module preset, which repackages the server build as dist/server/index.mjs (confirmed via a real build). @tanstack/start-plugin-core's vite preview integration derives the file it imports from the vite-level server entry (tanstackStart.server.entry: "server" -> server.js), with no awareness of nitro's repackaging -- server.js is never produced. Confirmed identical logic between the installed @tanstack/start-plugin-core@1.171.19 and latest 1.171.24: no upstream fix exists yet for a nitro-repackaged deploy target. Use wrangler dev against the real built Worker instead -- the same mechanism deploy:built/version:built already use just above this script, and what the root's existing ui:preview already does for the full monorepo build. apps/loopover-miner-ui's own vite preview is unaffected (plain Node preset, no nitro repackaging) and left untouched. Verified end-to-end: built the real app, ran the fixed preview script, confirmed a genuine 200 with real SSR-rendered HTML via a direct HTTP request. Added a regression test asserting the script's exact value, and documented the root cause + correct verification command in the contributing skill docs. Closes #7621
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 4256d93 | Commit Preview URL Branch Preview URL |
Jul 21 2026, 04:27 AM |
Bundle ReportChanges will increase total bundle size by 106 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-21 04:38:12 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|


Closes #7621
Summary
apps/loopover-ui'spreviewscript (vite preview) 500s on every request after any build --reproduced directly on
main:Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../dist/server/server.js'. Root cause:@tanstack/start-plugin-core's preview integration derivesthe expected filename from the vite-level server entry (
server.js), but this app's pinned nitrocloudflare-modulepreset repackages the build asdist/server/index.mjsinstead -- confirmed via areal build, and confirmed no upstream fix exists yet (identical logic between the installed
@tanstack/start-plugin-core@1.171.19and latest1.171.24). Fixesapps/loopover-ui's ownpreviewscript to use
wrangler devagainst the real built Worker instead -- the same mechanismdeploy:built/version:builtalready use, and what the root's existingui:previewscript alreadydoes for the full monorepo build.
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
package.jsonscript value + atest/**regression test + a docs update, none undersrc/**, so it owes no Codecov patch-coverage number. Verified end-to-end, not just asserted: built thereal app, ran the fixed
previewscript, and confirmed a genuine200with real SSR-rendered HTML(correct
<title>, meta tags, asset references) via a direct HTTP request — both the raw failure andthe fix were reproduced against a real build, not inferred.
Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
Not applicable — fixes a broken local verification command, no change to the deployed app itself.
Notes
apps/loopover-miner-ui's ownvite previewis unaffected and unrelated (different, plain Nodetarget with no nitro repackaging) — confirmed via its
vite.config.tsand its own passing regressiontest for the analogous Chat governor and discover/attempt action registration is missing from configurePreviewServer, unlike every sibling vite-*-api.ts plugin #7228, so it was deliberately left untouched.