fix CI SPA prerender build
CI / Typecheck, test & build (push) Failing after 2m3s
CI / Deploy to Cloudflare Workers (push) Has been skipped

This commit is contained in:
2026-08-31 01:22:01 +08:00
parent a0d0bd8b08
commit 848de4e309
5 changed files with 265 additions and 419 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ progress, so upload UIs stay indeterminate.
The app is a client-rendered SPA served as static assets by a Cloudflare Worker The app is a client-rendered SPA served as static assets by a Cloudflare Worker
(`wrangler.jsonc`, `not_found_handling: single-page-application`). The build (`wrangler.jsonc`, `not_found_handling: single-page-application`). The build
emits `_shell.html`, which is copied to `index.html` so Cloudflare's SPA emits `dist/client/_shell.html`, which is copied to `index.html` so Cloudflare's SPA
fallback returns it for every client route. fallback returns it for every client route.
**Manual deploy** (needs `wrangler login` or `CLOUDFLARE_API_TOKEN` / **Manual deploy** (needs `wrangler login` or `CLOUDFLARE_API_TOKEN` /
+2 -3
View File
@@ -13,14 +13,14 @@
"test": "vitest run", "test": "vitest run",
"gen:api": "node scripts/gen-api.mjs", "gen:api": "node scripts/gen-api.mjs",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"cf:build": "vite build && node -e \"require('fs').copyFileSync('.output/public/_shell.html','.output/public/index.html')\"", "cf:build": "vite build && node -e \"require('fs').copyFileSync('dist/client/_shell.html','dist/client/index.html')\"",
"cf:deploy": "pnpm cf:build && wrangler deploy" "cf:deploy": "pnpm cf:build && wrangler deploy"
}, },
"dependencies": { "dependencies": {
"@hookform/resolvers": "^5.4.0", "@hookform/resolvers": "^5.4.0",
"@tailwindcss/vite": "^4.1.18", "@tailwindcss/vite": "^4.1.18",
"@tanstack/react-devtools": "latest", "@tanstack/react-devtools": "latest",
"@tanstack/react-query": "^5.101.2", "@tanstack/react-query": "^5.102.8",
"@tanstack/react-router": "latest", "@tanstack/react-router": "latest",
"@tanstack/react-router-devtools": "latest", "@tanstack/react-router-devtools": "latest",
"@tanstack/react-router-ssr-query": "latest", "@tanstack/react-router-ssr-query": "latest",
@@ -33,7 +33,6 @@
"i18next": "^26.3.4", "i18next": "^26.3.4",
"lucide-react": "^0.545.0", "lucide-react": "^0.545.0",
"next-themes": "^0.4.6", "next-themes": "^0.4.6",
"nitro": "npm:nitro-nightly@latest",
"radix-ui": "^1.6.2", "radix-ui": "^1.6.2",
"react": "^19.2.0", "react": "^19.2.0",
"react-dom": "^19.2.0", "react-dom": "^19.2.0",
+261 -412
View File
File diff suppressed because it is too large Load Diff
-2
View File
@@ -5,7 +5,6 @@ import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react' import viteReact from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite' import tailwindcss from '@tailwindcss/vite'
import { nitro } from 'nitro/vite'
// SPA mode: auth is Bearer-token client-side (localStorage), so route guards // SPA mode: auth is Bearer-token client-side (localStorage), so route guards
// and data fetching must not run during SSR. // and data fetching must not run during SSR.
@@ -14,7 +13,6 @@ const config = defineConfig({
plugins: [ plugins: [
devtools(), devtools(),
tanstackStart({ spa: { enabled: true } }), tanstackStart({ spa: { enabled: true } }),
nitro({ rollupConfig: { external: [/^@sentry\//] } }),
tailwindcss(), tailwindcss(),
viteReact(), viteReact(),
], ],
+1 -1
View File
@@ -8,7 +8,7 @@
// `pnpm cf:build` copies the TanStack Start shell to index.html, which // `pnpm cf:build` copies the TanStack Start shell to index.html, which
// `single-page-application` handling serves for any non-asset request. // `single-page-application` handling serves for any non-asset request.
"assets": { "assets": {
"directory": ".output/public", "directory": "dist/client",
"not_found_handling": "single-page-application" "not_found_handling": "single-page-application"
}, },
"observability": { "observability": {