HMR triggers full page load on component edit

Abierto
#877 3 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
nuxt, tailwindcss, typescript, vite

Línea de trabajo

Start with the StackBlitz reproduction and compare the HMR logs when the Tailwind module is installed versus absent. Check edits to pages/index.vue, components/not-used.vue, and utils/test.ts; done means unused component and TypeScript changes no longer trigger a full page reload.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
Environment
  • Operating System: Darwin
  • Node Version: v20.11.0
  • Nuxt Version: 3.12.3
  • CLI Version: 3.12.0
  • Nitro Version: 2.9.7
  • Package Manager: bun@1.1.18
  • Builder: -
  • User Config: compatibilityDate, devtools, modules
  • Runtime Modules: @nuxtjs/tailwindcss@6.12.2-1720701009.60a4bba
  • Build Modules: -
Reproduction

https://stackblitz.com/edit/github-xdbpil?file=pages%2Findex.vue

Describe the bug

As soon as i install the nuxt tailwindcss module, the HMR triggers a page reload.

With tailwind module

[nuxt] builder:watch: 0.48ms                                                                                                 
[nuxt] builder:watch: 0.521ms                                                                                                   
  vite:hmr [file change] components/not-used.vue +6s
ℹ page reload components/not-used.vue                                   

Having a plain nuxt application, without tailwind installed will not trigger a page reload.

Without tailwind module

[nuxt] builder:watch: 0.434ms                                                                                                    
[nuxt] builder:watch: 0.488ms                                                                                                    
  vite:hmr [file change] components/not-used.vue +11s
  vite:hmr [no modules matched] components/not-used.vue +0ms

However, if you change files/components which are part of the current page, even with the tailwindcss plugin there is no complete page-reload:

With tailwind module + component is used in current page

  vite:hmr [file change] components/not-used.vue +4s
[nuxt] builder:watch: 0.146ms                                                                                                  
[nuxt] builder:watch: 0.181ms                                                                                                   
  vite:hmr [vue:update(template)] {MY_ROOT_DIR}/components/not-used.vue +1m
ℹ hmr update /components/not-used.vue, /node_modules/tailwindcss/tailwind.css

The same behaviour counts for .ts files. Changes within them will trigger a whole page reload, which does not happen without the @nuxtjs/tailwindcss module.

With tailwind module

  vite:hmr [file change] utils/test.ts +9s
ℹ page reload utils/test.ts                                     

Without tailwind module

[nuxt] builder:watch: 1.331ms                                                                                                   
  vite:hmr [file change] utils/test.ts +4s
  vite:hmr [no modules matched] utils/test.ts +0ms        
Additional context

No response

Logs

No response

Lenguaje dominante
TypeScript
Estrellas
1.9k
Forks
192
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nuxt-modules/tailwindcss

Todos los issues de nuxt-modules/tailwindcss

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.