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

next/headers call prevent sitemap generation #692

Closed
bastienrobert opened this issue Aug 8, 2023 · 7 comments
Closed

next/headers call prevent sitemap generation #692

bastienrobert opened this issue Aug 8, 2023 · 7 comments
Assignees
Labels
bug Something isn't working no-issue-activity

Comments

@bastienrobert
Copy link

Describe the bug
When headers() (imported from next/headers) is called in a layout.js or in a page.js file, next-sitemap doesn't generate.

To Reproduce
Link to the repro: https://github.com/bastienrobert/next-sitemap-generation-with-headers-repro

Steps to reproduce the behavior:

  • create a new project with pnpm create next-app
  • install next sitemap
  • create a basic next-sitemap.config.js file
  • add postbuild script
  • add headers() call (from next/headers) in layout.js
  • run pnpm build
  • run pnpm postbuild

sitemap is empty

  • remove headers() in layout.js
  • run pnpm build
  • run pnpm postbuild

sitemap-0.xml is generated

Expected behavior
sitemap-0.xml generation event if there's a headers() call.

@bastienrobert bastienrobert added the bug Something isn't working label Aug 8, 2023
@github-actions
Copy link

github-actions bot commented Oct 8, 2023

Closing this issue due to inactivity.

@TheCatLady
Copy link

Running into this same issue with cookies()... sitemap-0.xml is only generated if the cookies() call is removed.

@pranavks
Copy link

pranavks commented Dec 7, 2023

+1

@LouisCuvelierStadion
Copy link

LouisCuvelierStadion commented Dec 19, 2023

Same here when headers() are called on a not-found.js

@AlexanderBich
Copy link

+1

@bastienrobert
Copy link
Author

Please don't "+1", use the Github reactions feature

Copy link

Closing this issue due to inactivity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity
Projects
None yet
Development

No branches or pull requests

6 participants