mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #871] usePathname temporarily resolves to "/" on the client before navigating to the correct pathname #191
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Bananamilk452 on GitHub (Apr 22, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/871
Description
When using
usePathname, the server correctly logs the expected pathname (e.g."/home"), but on the client side it briefly resolves to"/"before moving to the correct path. This mismatch causes a hydration error.Steps to Reproduce
usePathnamein a componentconsole.log/home/homecorrectly, but the client initially logs/before correcting to/homeExpected Behavior
usePathnameshould return the correct pathname on both server and client without any intermediate"/"state.Actual Behavior
usePathname→"/home"✅usePathname→"/"❌usePathname→"/home"✅Additional Context
This may be a regression of #688 — needs verification.