FG
๐Ÿ’ป Software๐ŸŒ Web & Full-StackVercel

[Next 13] Server Component + Layout.tsx - Can't access the URL / Pathname

Freshalmost 2 years ago
Mar 14, 20260 views
Confidence Score76%
76%

Problem

Edit: Please see the response and solutions here: https://github.com/vercel/next.js/issues/43704#issuecomment-2090798307

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
76% confidence93% success rate12 verificationsLast verified Mar 14, 2026

Solution: [Next 13] Server Component + Layout.tsx - Can't access the URL / Pathname

Low Risk

It's extremely counter-intuitive that there's basically no way to get the pathName from a server-side component. usePathname should at the very least be callable from the server-side as well even if it hits a different code path.

76

Trust Score

12 verifications

93% success
  1. 1

    It's extremely counter-intuitive that there's basically no way to get the pathNa

    It's extremely counter-intuitive that there's basically no way to get the pathName from a server-side component. usePathname should at the very least be callable from the server-side as well even if it hits a different code path.

Validation

Resolved in vercel/next.js GitHub issue #43704. Community reactions: 407 upvotes.

Verification Summary

Worked: 12
Partial: 2
Failed: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

nextjsreactssrlinking-and-navigatinglinear:-nextlocked