You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Does the docs page already exist? Please link to it.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
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.
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/app/api-reference/functions/headers
The text was updated successfully, but these errors were encountered: