-
Notifications
You must be signed in to change notification settings - Fork 30k
Closed
Copy link
Labels
TypeScriptRelated to types with Next.js.Related to types with Next.js.
Description
Link to the code that reproduces this issue
https://github.com/therungg/next-sitemap-generation-typing-bug
To Reproduce
- Create a sitemap as per the docs https://nextjs.org/docs/app/api-reference/functions/generate-sitemaps#example
awaitthe id in the sitemap function- The id is actually a string, not a number
Current vs. Expected behavior
The id received in the sitemap function is actually a string, not a number as the type indicates. I expect it to be a number.
This means that, for example, doing a switch case over the id does not work, because it never matches the number in the switch case. See reproduction repo for minimal repro
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:30:46 UTC 2025
Available memory (MB): 8937
Available CPU cores: 16
Binaries:
Node: 22.13.1
npm: 10.9.2
Yarn: N/A
pnpm: 10.0.0
Relevant Packages:
next: 16.1.0-canary.16 // Latest available version is detected (16.1.0-canary.16).
eslint-config-next: N/A
react: 19.2.1
react-dom: 19.2.1
typescript: 5.9.3
Next.js Config:
output: N/AWhich area(s) are affected? (Select all that apply)
TypeScript
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
No response
Metadata
Metadata
Assignees
Labels
TypeScriptRelated to types with Next.js.Related to types with Next.js.