sitemap missing (SvelteKit)
What this means
Section titled “What this means”No static/sitemap.xml and no dynamic sitemap endpoint at src/routes/sitemap.xml/+server.ts. Without a sitemap, search engines rely on link discovery alone. Pages with no inbound links may never be indexed.
How to fix it
Section titled “How to fix it”For sites where URLs are not known at build time, create a dynamic endpoint that generates the sitemap on request.
import type { RequestHandler } from './$types'
export const GET: RequestHandler = async () => { const pages = await getPages()
const urls = pages .map(p => ` <url><loc>https://example.com${p.path}</loc></url>`) .join('\n')
const body = `<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">${urls}</urlset>`
return new Response(body, { headers: { 'Content-Type': 'application/xml' }, })}For fully static sites, a static/sitemap.xml file is simpler and requires no code.
<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://example.com/</loc> <lastmod>2025-01-01</lastmod> <priority>1.0</priority> </url></urlset>Verify the fix
Section titled “Verify the fix”curl https://yourdomain.com/sitemap.xmlConfirm the response is valid XML with <urlset> as the root element. Then re-run orino audit.