Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Server and client implementations disagree with each other

Aperta
#317 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
nuxtjs, typescript
Ambito
full-stack

Direzione di ricerca

The mismatch comes from generateFlags running on the server with CloudFlare headers (cf-device-type overriding isMobile) and on the client with only navigator.userAgent. Start by tracing where both paths compute flags and how the server result reaches the client. Done means the server-rendered and client-hydrated flags match for the same request, and the issue doesn't say which approach the maintainers want.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

This module computes its properties both on the server and on the client independently.
Unfortunately they tend to disagree with each other when it comes to CloudFlare headers (they always win over user agents), which results in a lot of hydration errors (for us).

cf-device-type forces isMobile to false on the server side if its value is desktop or tablet.

The client, on the other hand, calls generateFlags(navigator.userAgent) with no headers and the module doesn't seem to copy over the server-side values to the client-side (e.g. using useState), which can result in differences (and does).

It would be great if server and client would share the same detection results.

Lingua principale
TypeScript
Stelle
1k
Fork
55
Merge medio
2g 10h
PR unite (30g)
9

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nuxt-modules/device

Tutte le issue di nuxt-modules/device

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.