-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Description
What is the improvement or update you wish to see?
NextJS docs would be greatly improved with a detailed list of NextJS specific headers such as 'next-url'. Also, a recommended approach to obtaining the url pathname in server components would be a great addition as the headers() function does not always contain the desired information.
Is there any context that might help us understand?
The headers documentation would greatly benefit from the list of nextjs specific headers such as "next-url". Searching for 'next-url' in the docs produces no results, yet there are numerous examples online of its use to fetch the pathname in server components.
Furthermore, 'next-url' is unreliable as mentioned here in stackoverflow. The 'next-url' header is not present when navigating directly to a NextJS page (app router) but will eventually show up with HMR (in my experience). The solution suggested in Stackoverflow works perfectly, but this does seem like a band-aid for a possibly misunderstood logic.