Ctrl+C leaves `cf dev` stuck at "Terminate batch job (Y/N)?" on Windows in npm projects
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
- #413 de @Cherry — cerrado sin fusionar
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- node.js, typescript
- Área
- cli, developer-experience
Línea de trabajo
The report describes cf dev and cf build launching npm.cmd or npx.cmd through cmd.exe on Windows; no source files or tests are named. Start by tracing how the CLI resolves and launches these commands, then reproduce Ctrl+C in an npm project on Windows. Done means the server stops and cf exits without the batch-job prompt; the linked pull request indicates this work is already under way.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary of the issue
On Windows, when cf dev or cf build runs the framework through npm (for example npx astro dev), pressing Ctrl+C stops the dev server but cf doesn't exit. The terminal shows cmd's Terminate batch job (Y/N)? and waits for an answer.
cf resolves npm/npx to the npm.cmd/npx.cmd that ship with Node and runs them through cmd.exe. Unlike the cmd-shim launchers in node_modules\.bin, those two don't end the batch context before starting Node, so cmd asks about the interrupted batch file once npm exits. Running npm run dev directly in PowerShell doesn't hit this because PowerShell uses npm.ps1.
pnpm projects show the same prompt from pnpm's own node_modules\.bin\*.cmd shims, which is outside cf.
Expected behaviour
Ctrl+C stops the dev server and cf exits, the same as on macOS and Linux, and the same as running npm run dev yourself in PowerShell.
Version of cf used
1.0.0-beta.21
System information and package versions
System:
OS: Windows 11 10.0.26300
CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
Memory: 8.60 GB / 31.91 GB
Binaries:
Node: 26.12.0
npm: 11.18.0
pnpm: 12.14.0
Reproduction (optional)
In PowerShell or Windows Terminal, in an npm project cf runs through npx (for example Astro):
cf dev
# wait for the dev server, then press Ctrl+C
The dev server shuts down, then Terminate batch job (Y/N)? appears and cf keeps running until you answer it.
Relevant error logs (optional)
│ Delegating to npx astro dev
...
Terminate batch job (Y/N)?
- Lenguaje dominante
- TypeScript
- Estrellas
- 916
- Forks
- 53
- Merge medio
- 23 h 30 min
- PR fusionados (30 d)
- 216
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 14 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
-
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
cloudflare/cf#421 ·
Los mantenedores suelen responder en 1 día
Todos los issues de cloudflare/cf
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
keptinventory/kept#336 ·
Los mantenedores suelen responder en 1 día
-
good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
hemi-earn
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
vetro-protocol/vetro-monorepo#1013 ·
Los mantenedores suelen responder en 1 día