Skip to content
New issue

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

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

Already on GitHub? # to your account

[DynamicIO] [Sitemap] Unable to create a cached/static sitemap.ts with use cache #74146

Closed
mwskwong opened this issue Dec 19, 2024 · 2 comments · Fixed by #74835
Closed

[DynamicIO] [Sitemap] Unable to create a cached/static sitemap.ts with use cache #74146

mwskwong opened this issue Dec 19, 2024 · 2 comments · Fixed by #74835
Assignees
Labels
bug Issue was opened via the bug report template. dynamicIO Related to dynamicIO. locked

Comments

@mwskwong
Copy link

mwskwong commented Dec 19, 2024

Link to the code that reproduces this issue

https://github.com/mwskwong/next-dynamic-io-sitemap-cache-bug

To Reproduce

  1. Comment/uncomment use cache in sitemap.ts
  2. Run npm run build and observe the build result with and without use cache

Current vs. Expected behavior

Current
When using use cache in sitemap.ts, in an attempt to create a static sitemap, the following error is thrown during the built time.

PROD build error

Error occurred prerendering page "/sitemap.xml". Read more: https://nextjs.org/docs/messages/prerender-error
InvariantError: Invariant: Missing Client Reference Manifest for /sitemap.xml. This is a bug in Next.js.
    at v (path/to/.next/server/chunks/118.js:3:5880)
    at sitemap (path/to/.next/server/chunks/118.js:3:16025)
    at C (path/to/.next/server/app/sitemap.xml/route.js:1:1744)
    at runNextTicks (node:internal/process/task_queues:65:5)
    at process.processImmediate (node:internal/timers:459:9)
    at process.callbackTrampoline (node:internal/async_hooks:130:17)
    at async Immediate.<anonymous> (path/to/node_modules/next/dist/compiled/next-server/app-route-experimental.runtime.prod.js:18:17864)
Export encountered an error on /sitemap.xml/route: /sitemap.xml, exiting the build.
 ⨯ Static worker exited with code: 1 and signal: null

DEV build error

  Compiled /sitemap.xml in 10.2s (1246 modules)
  Error [InvariantError]: Invariant: Missing manifest for Server Actions. This is a bug in Next.js.
    at getClientReferenceManifestForRsc (..\..\..\src\server\app-render\encryption-utils.ts:139:10)
  137 |
  138 |   if (!serverActionsManifestSingleton) {
> 139 |     throw new InvariantError('Missing manifest for Server Actions.')
      |          ^
  140 |   }
  141 |
  142 |   const { clientReferenceManifestsPerPage } = serverActionsManifestSingleton

Expected
use cache should be able to use in sitemap.ts to create a static sitemap.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 32493
  Available CPU cores: 20
Binaries:
  Node: 22.12.0
  npm: 10.9.0
  Yarn: 1.22.19
  pnpm: 9.9.0
Relevant Packages:
  next: 15.1.1-canary.13 // Latest available version is detected (15.1.1-canary.13).
  eslint-config-next: 15.1.1-canary.13
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

dynamicIO

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local)

Additional context

Setting dynamic to force-static instead of using use cache doesn't seem to have any effect, properly due to dynamicIO being enabled,

@mwskwong mwskwong added the bug Issue was opened via the bug report template. label Dec 19, 2024
@github-actions github-actions bot added the dynamicIO Related to dynamicIO. label Dec 19, 2024
@mwskwong mwskwong changed the title [DynamicIO] [Sitemap] Unable to create a cached/static sitemap.ts [DynamicIO] [Sitemap] Unable to create a cached/static sitemap.ts with use cache Dec 19, 2024
@dualdetail
Copy link

I had the same issue, had to remove use cache from the functions needed for generating the sitemap for now.

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 Jan 28, 2025
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Issue was opened via the bug report template. dynamicIO Related to dynamicIO. locked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants