`nuxt dev` reload never finishes when a Nuxt `close` hook doesn't settle
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, nuxt, typescript
Línea de trabajo
Start in packages/nuxt-cli/src/dev/utils.ts at #load() and close(), then read the shutdown budget in packages/nuxt-cli/src/dev/pool.ts and its closeFork logic. Check existing dev reload tests and add coverage for a Nuxt close hook that never settles. Done means reload proceeds after the shutdown deadline, reports the unfinished hooks, and the test passes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Environment
@nuxt/cli4.0.3 (same code onmain, 7d4dec6)nuxt4.6.4,nitropack2.13.6,vite8.3.6- Node 24.22.2, Linux x64
Reproduction
https://github.com/mttzzz/nuxt-reload-close-hook-hang
The app has one local module:
// modules/hang-on-close.ts
import { defineNuxtModule } from 'nuxt/kit'
export default defineNuxtModule({
meta: { name: 'hang-on-close' },
setup(_options, nuxt) {
nuxt.hook('close', () => new Promise<void>(() => {}))
},
})
npm i && npx nuxt dev, the page showsmarker: one- change
marker: 'one'to'two'innuxt.config.ts
Describe the bug
After step 2 the page switches to the loading screen (503) and stays there (I waited 80 s), the reload is never reported as done. Saving nuxt.config.ts again does nothing, since the config watcher is closed before the reload and only re-armed after it. Ctrl-C still exits right away, so restarting nuxt dev is the only way out.
Without the module the same edit reloads in about 1 s. The same kind of hook in a Nitro plugin (nitroApp.hooks.hook('close', () => new Promise(() => {}))) only delays the reload by about 5 s: nitropack terminates the dev worker after NITRO_SHUTDOWN_TIMEOUT, and the reload goes on.
This came up in #1328, where @danielroe asked for a separate issue.
Cause
An in-place reload (a nuxt.config change, removed build output, nuxt.callHook('restart') from a module) goes through #load(), which awaits close(), and close() awaits this.#currentNuxt.close() with no deadline:
nuxt.close() calls the close hooks one after another, so the hooks registered after the module (Nitro's, Vite's, the builder watchers) are never called either.
Shutting the fork down already has a budget: closeFork waits DEV_SHUTDOWN_TIMEOUT_MS (10 s), then sends SIGTERM and SIGKILL:
The reload could get the same budget: race currentNuxt.close() against DEV_SHUTDOWN_TIMEOUT_MS, warn that the close hooks didn't finish, and go on with the reload. I can send a PR for that.
- Lenguaje dominante
- TypeScript
- Estrellas
- 402
- Forks
- 125
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 37
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- 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 nuxt/cli
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nuxt/cli#1677 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
dev: false "reachable from the network" warning when `devServer.host` is a `*.localhost` subdomainQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
nuxt/cli#1644 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
nuxt/cli#1670 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Issues similares
-
[Bug]: Search input loses focus while typing on the Inventory, Reservations and Locations lists (view_configurations enabled)Posiblemente ocupada @medusa-os-bot la tomó hoy. Abiertostatus: needs triaging type: bug version: 2.0
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
medusajs/medusa#17886 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
marimo-team/marimo#11949 ·
Los mantenedores suelen responder en 1 día
-
bug server-time v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
modelcontextprotocol/servers#5559 ·
Los mantenedores suelen responder en 1 día
-
D1 Time Travel restore help advertises 30 days without a plan qualifierPosiblemente ocupada @akhil9tiet la tomó hoy. Abiertobug package:wrangler product:d1
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
cloudflare/workers-sdk#17000 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug severity:medium triage:confirmed triage:reproduced
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Cotal-AI/Cotal#7440 · 2 comentarios ·
Los mantenedores suelen responder en 1 día