Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: next-url #57762

Closed
cyber-nic opened this issue Oct 30, 2023 · 2 comments
Closed

Docs: next-url #57762

cyber-nic opened this issue Oct 30, 2023 · 2 comments
Labels
Documentation Related to Next.js' official documentation. locked

Comments

@cyber-nic
Copy link

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

@cyber-nic cyber-nic added the Documentation Related to Next.js' official documentation. label Oct 30, 2023
@leerob
Copy link
Member

leerob commented Nov 8, 2023

@leerob leerob closed this as completed Nov 8, 2023
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Related to Next.js' official documentation. locked
Projects
None yet
Development

No branches or pull requests

2 participants