cf build/dev --mode fails for TanStack Start even though the detected command is vite build/dev (1.0.0-beta.28)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript, vite
- Área
- cli
Línea de trabajo
Empieza por localizar la clase del framework TanStack Start en la autoconfig integrada y compara su ajuste supportsMode con las clases de Vite y Astro; sigue la comprobación de cf build descrita en el issue. Confirma el comportamiento con la reproducción proporcionada usando cf build --mode production y cf dev --mode production; el trabajo estará terminado cuando ambos acepten --mode para TanStack Start.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened
In a TanStack Start project, cf build --mode <name> and cf dev --mode <name> both fail before anything runs:
$ cf build --mode production
┌ Error
│ The detected command `bunx vite build` does not currently support `--mode`.
└
$ cf dev --mode production
┌ Error
│ The detected command `bunx vite dev` does not currently support `--mode`.
└
(With npm the command is shown as npx vite build.)
The detected command is plain vite build / vite dev, and Vite accepts --mode. The same project without @tanstack/react-start installed works: cf build --mode production delegates to vite build "--mode" "production" and succeeds.
Minimal reproduction
mkdir cf-mode-repro && cd cf-mode-repro
cat > package.json <<'JSON'
{ "name": "cf-mode-repro", "private": true, "type": "module",
"devDependencies": { "vite": "8.3.6", "@cloudflare/vite-plugin": "2.0.0-beta.v.12", "cf": "1.0.0-beta.28" } }
JSON
cat > vite.config.ts <<'TS'
import { defineConfig } from "vite";
import { cloudflare } from "@cloudflare/vite-plugin";
export default defineConfig({ plugins: [cloudflare()] });
TS
mkdir src && echo 'export default { fetch() { return new Response("ok") } }' > src/index.ts
cat > cloudflare.config.ts <<'TS'
import { defineConfig } from "cf/config";
export default defineConfig({ worker: { name: "cf-mode-repro", entrypoint: "./src/index.ts", compatibilityDate: "2026-11-01" } });
TS
bun install
cf build --mode production # works: "Delegating to bunx vite build "--mode" "production""
bun add -d @tanstack/[email protected] react@19 react-dom@19
cf build --mode production # fails: "does not currently support `--mode`"
cf dev --mode production # fails the same way
Likely cause
In the bundled autoconfig, the Vite and Astro framework classes set supportsMode = true, but the TanStack Start class extends the base Framework class (supportsMode = false). Its configuration still reports buildTool: "vite", and the build and dev commands are <pm> vite build / <pm> vite dev. cf build then throws on if (buildCommand && mode && !framework.supportsMode).
Setting supportsMode = true for TanStack Start (or deriving it from buildTool === "vite") should fix it.
Why it matters
defineConfig(({ mode }) => …) can't branch on mode for TanStack Start projects through cf. That rules out a staging or preview Worker. Our workaround is to call vite build --mode <name> directly and skip cf build.
Environment
cf1.0.0-beta.28,@cloudflare/vite-plugin2.0.0-beta.v.12,@tanstack/react-start1.169.4, Vite 8.3.6- macOS (arm64), Node 26.13, Bun 1.4.4. Also reproduced with npm (no lockfile, monorepo workspace).
Related
#45 covers the same error for Nuxt and Next.js, which don't build through Vite. This one is narrower: TanStack Start already builds through vite, so only the supportsMode flag is missing.
- Lenguaje dominante
- TypeScript
- Estrellas
- 993
- Forks
- 65
- Merge medio
- 21 h 51 min
- PR fusionados (30 d)
- 209
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudflare/cf
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
cloudflare/cf#344 ·
Los mantenedores suelen responder en 1 día
-
upstream
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cloudflare/cf#262 ·
Los mantenedores suelen responder en 1 día
-
`cf dev` rejects `--port` and `--host` for Vite projects, including the `cf init` templatePosiblemente ocupada @jamesopstad la tomó hace 26 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
cloudflare/cf#223 · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
upstream
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cloudflare/cf#179 ·
Los mantenedores suelen responder en 1 día
-
`cf migrate` fails with `ERR_PNPM_IGNORED_BUILDS` in a pnpm workspace that has not approved workerdAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
cloudflare/cf#511 ·
Los mantenedores suelen responder en 1 día
Todos los issues de cloudflare/cf
Issues similares
-
area:cards enhancement ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
fil-donadoni/tolaria#8883 ·
Los mantenedores suelen responder en 1 día
-
xsd:integer cast from a string rejects negative numbers, a leading + and surrounding whitespaceAbiertobug 🐛
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
comunica/comunica#1960 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Waiting for: Product Owner
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
getsentry/sentry-javascript#26203 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
bytedance/flowgram.ai#1235 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
devswha/herdr-web-ui#3325 ·