sitemap not being served from nitro build
Open
Nobody has claimed this yet.
information needed
- Dominant language
- TypeScript
- Stars
- 15.1k
- Forks
- 1.9k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 143
Description
Which project does this relate to?
Start
Describe the bug
When generating a sitemap with nitro, the production server throws a 404 on /sitemap.xml.
Your Example Website or App
.
Steps to Reproduce the Bug or Issue
vite.config.js
nitro({ preset: 'node-server' }),
tanstackStart({
prerender: {
enabled: true,
crawlLinks: false,
},
sitemap: {
enabled: true,
host: 'https://example.com',
},
Expected behavior
npm run start serves the built application and /sitemap.xml works
Screenshots or Videos
The server.mjs has this list of assets that is missing to include sitemap.xml:
const assets = {
"/favicon.png": {
"type": "image/png",
"etag": '"58d2-yz8RygUU2g7H6U101cbusIN4uDA"',
"mtime": "2026-02-02T08:11:51.383Z",
"size": 22738,
"path": "../public/favicon.png"
},
...
Platform
- Router / Start Version: [e.g. 1.121.0]
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Browser Version: [e.g. 91.1]
- Bundler: [e.g. vite]
- Bundler Version: [e.g. 7.0.0]
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with vite.config.js and the generated server.mjs, then run npm run start and request /sitemap.xml using the shown Nitro node-server and prerender configuration. Compare the generated asset list with the expected sitemap output; done means the production server serves /sitemap.xml without a 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vite
- Domain
- backend, build-system, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100