Server and client implementations disagree with each other
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 22/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- nuxtjs, typescript
- Bereich
- full-stack
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 1k
- Forks
- 55
- Ø Merge
- 2 T. 10 Std.
- Gemergte PRs (30 T.)
- 9
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus nuxt-modules/device
-
Cloudfront detection shouldn't rely on user-agentEvtl. vergeben @luc122c hat das vor 7 Tagen übernommen. Offenpending triage
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
nuxt-modules/device#141 · 1 Kommentar · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Custom flag in Nuxt 3Offen3.x enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
nuxt-modules/device#129 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Dependency DashboardOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 10/100
nuxt-modules/device#95 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Huawei checkOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
nuxt-modules/device#89 ·
Maintainer antworten meist innerhalb von 1 Tag
-
3.x enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 25/100
nuxt-modules/device#87 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in nuxt-modules/device
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
polarsource/polar#15580 ·
Maintainer antworten meist innerhalb von 1 Tag
-
accepted bug via-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 69/100
pingdotgg/t3code#20931 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug/1-unconfirmed kind/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 83/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ranxianglei/billion-context#3583 ·
Maintainer antworten meist innerhalb von 1 Tag