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

Include dynamically rendered pages in sitemap #812

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

OzzieOrca
Copy link

Add manifest.routes.staticRoutes to allKeys in createUrlSet.

Just taking a very naive stab at this, not sure this is even the right part of the manifest to pull these dynamically rendered paths from but I found my missing pages inside of it. This seems to pick up some of the pages that went missing as soon as I called headers() or cookies() from import { headers, cookies } from 'next/headers'; in my page or layout.

Opting into dynamic rendering seems to put the page in a different place in the build output manifest:

headers() is a Dynamic Function whose returned values cannot be known ahead of time. Using it in a layout or page will opt a route into dynamic rendering at request time.

https://nextjs.org/docs/app/api-reference/functions/headers

Does this approach seem like a good direction? Any feedback? Just trying to start a conversation and hopefully solve #692 and #743.

Looks like there was an earlier attempt at #759.

I'm testing with Next v14.2.3 and patched next-sitemap v4.2.3 locally to test.

Add staticRoutes to allKeys in createUrlSet
Copy link

vercel bot commented May 15, 2024

@OzzieOrca is attempting to deploy a commit to the Vishnu Sankar's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant