Summary
vinext deploy --prerender-all always fails at the pre-render step with No build output found in dist (preceded by prerender secret not found). The deploy's build phase (createBuilder().buildApp() with @cloudflare/vite-plugin active) emits the Cloudflare Worker bundle but not the dist/server output + prerender secret that the subsequent runPrerender() needs — so the prerender step can't run.
This matters because --prerender-all is the only documented way to make an fs-backed Pages Router SSG app work on Workers (see #15). Combined with #15 (plain vinext deploy runs getStaticProps per request → fs unavailable on Workers → 500), the result is: there is currently no working vinext deploy path for a Pages Router app whose getStaticProps reads the filesystem at build time.
Log — Cloudflare Workers Build, npx vinext deploy --prerender-all
✓ built in 4.21s
Pre-rendering all routes...
[vinext] Warning: prerender secret not found. /__vinext/prerender/* endpoints will
return 403 and dynamic routes will produce no paths. Run `vinext build`
to regenerate the secret.
[vinext] No build output found in /opt/buildhome/repo/dist
Run `vinext build` first.
Failed: error occurred while running deploy command
Reproduces locally
vinext build --prerender-all with cloudflare() active → same No build output found in dist (the ✓ built in ~1s, 8xx modules line is the worker-only build; the native dist/server entry + secret are never produced).
vinext build --prerender-all with cloudflare() removed → succeeds, Prerendered 809 routes, and vinext start then serves every route 200 with zero per-request fs. So the prerender machinery itself is fine — it's specifically incompatible with the cloudflare build output.
Root conflict
runPrerender needs vinext's native dist/server build + the prerender secret, which are generated by vinext build's own build path (cli.js), not by createBuilder().buildApp().
vinext deploy builds via buildApp(), which under @cloudflare/vite-plugin emits a workerd Worker and neither the dist/server entry nor the secret.
- Net: prerender requires cloudflare OFF; the workerd Worker requires cloudflare ON. They're mutually exclusive in 0.1.8. No flag arrangement yields both — incl. the split
vinext build --prerender-all (cloudflare off → Node-targeted build, not a workerd Worker) followed by vinext deploy --skip-build.
Expected
vinext deploy --prerender-all should generate the prerender secret + the prerenderable dist/server output (e.g. run the native build, or have buildApp emit it) before runPrerender, so prerendered SSG pages ship as static assets alongside the Worker.
Related upstream (cloudflare/vinext)
Environment
vinext 0.1.8, Vite 8.1, Pages Router, Cloudflare Workers Build (/opt/buildhome/repo).
Summary
vinext deploy --prerender-allalways fails at the pre-render step withNo build output found in dist(preceded byprerender secret not found). The deploy's build phase (createBuilder().buildApp()with@cloudflare/vite-pluginactive) emits the Cloudflare Worker bundle but not thedist/serveroutput + prerender secret that the subsequentrunPrerender()needs — so the prerender step can't run.This matters because
--prerender-allis the only documented way to make an fs-backed Pages Router SSG app work on Workers (see #15). Combined with #15 (plainvinext deployrunsgetStaticPropsper request →fsunavailable on Workers → 500), the result is: there is currently no workingvinext deploypath for a Pages Router app whosegetStaticPropsreads the filesystem at build time.Log — Cloudflare Workers Build,
npx vinext deploy --prerender-allReproduces locally
vinext build --prerender-allwithcloudflare()active → sameNo build output found in dist(the✓ built in ~1s, 8xx modulesline is the worker-only build; the nativedist/serverentry + secret are never produced).vinext build --prerender-allwithcloudflare()removed → succeeds,Prerendered 809 routes, andvinext startthen serves every route 200 with zero per-requestfs. So the prerender machinery itself is fine — it's specifically incompatible with the cloudflare build output.Root conflict
runPrerenderneeds vinext's nativedist/serverbuild + the prerender secret, which are generated byvinext build's own build path (cli.js), not bycreateBuilder().buildApp().vinext deploybuilds viabuildApp(), which under@cloudflare/vite-pluginemits a workerd Worker and neither thedist/serverentry nor the secret.vinext build --prerender-all(cloudflare off → Node-targeted build, not a workerd Worker) followed byvinext deploy --skip-build.Expected
vinext deploy --prerender-allshould generate the prerender secret + the prerenderabledist/serveroutput (e.g. run the native build, or havebuildAppemit it) beforerunPrerender, so prerendered SSG pages ship as static assets alongside the Worker.Related upstream (cloudflare/vinext)
/api-...and lazy catchall pages never finish loading cloudflare/vinext#1542 — Pages Router prerender: lazy catchall pages never finish loading (related prerender bug; OPEN)Environment
vinext 0.1.8, Vite 8.1, Pages Router, Cloudflare Workers Build (
/opt/buildhome/repo).