{"record":{"id":"2092dc93472d57b8","repo":"withastro/astro","slug":"no-pages-found-outfile-not-created","errorCode":null,"errorMessage":"No pages found!\n`${outFile}` not created.","messagePattern":"No pages found!\n`(.+?)` not created\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/integrations/sitemap/src/index.ts","lineNumber":177,"sourceCode":"\n\t\t\t\t\t\taddRouteUrl(urls, r);\n\n\t\t\t\t\t\t// Include i18n fallback routes (e.g. /fr/ falling back to /en/)\n\t\t\t\t\t\tfor (const fallbackRoute of r.fallbackRoutes ?? []) {\n\t\t\t\t\t\t\taddRouteUrl(urls, fallbackRoute);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn urls;\n\t\t\t\t\t}, []);\n\n\t\t\t\t\tpageUrls = Array.from(new Set([...pageUrls, ...routeUrls, ...(customPages ?? [])]));\n\n\t\t\t\t\tif (filter) {\n\t\t\t\t\t\tpageUrls = pageUrls.filter((value) => filter(value));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (pageUrls.length === 0) {\n\t\t\t\t\t\tlogger.warn(`No pages found!\\n\\`${outFile}\\` not created.`);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet urlData = generateSitemap(pageUrls, finalSiteUrl.href, opts);\n\n\t\t\t\t\tif (serialize) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst serializedUrls: SitemapItem[] = [];\n\t\t\t\t\t\t\tfor (const item of urlData) {\n\t\t\t\t\t\t\t\tconst serialized = await Promise.resolve(serialize(item));\n\t\t\t\t\t\t\t\tif (serialized) {\n\t\t\t\t\t\t\t\t\tserializedUrls.push(serialized);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (serializedUrls.length === 0) {\n\t\t\t\t\t\t\t\tlogger.warn('No pages found!');\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/withastro/astro/blob/157c500c38faa7ecf1251adbaeefcd109470d75c/packages/integrations/sitemap/src/index.ts#L159-L195","documentation":"After the Sitemap integration collects pageUrls from built pages, resolved routes, and customPages, applies the filter option, and dedupes, it checks for an empty list. If zero URLs remain, it warns 'No pages found!' together with the would-be output filename and returns without writing any sitemap file. The build still exits successfully.","triggerScenarios":" filter callback excludes every URL (e.g. filter: (url) => url.includes('/docs') on a site with no /docs routes); a build where all routes are non-page (API endpoints, redirects, 404) and customPages is unset; i18n/lastmod configurations that reduce the set to zero.","commonSituations":" A filter glob/match copied from another project that matches nothing here; sites whose content is all client-rendered or served from a single route; excluding pruned routes and accidentally excluding everything.","solutions":["Loosen or fix the filter option so at least one URL passes, e.g. filter: (page) => page !== 'https://example.com/secret'.","Add customPages: ['https://example.com/'] so at least the homepage is listed.","Print the URL list before filtering (log getStaticPaths output or config.integrations debug) to see what the filter is removing.","Confirm dist/ contains sitemap-index.xml after rebuilding; if you truly want no sitemap, remove the integration to silence the warning."],"exampleFix":"// before\nsitemap({\n  filter: (page) => page.includes('/blog/'), // site has no /blog routes -> zero URLs\n}),\n\n// after\nsitemap({\n  filter: (page) => !page.includes('/admin'),\n  customPages: ['https://www.example.com/'],\n}),","handlingStrategy":"validation","validationCode":"const sampleUrls = ['https://www.example.com/', 'https://www.example.com/blog/'];\nconst kept = typeof filter === 'function' ? sampleUrls.filter(filter) : sampleUrls;\nif (kept.length === 0) {\n  throw new Error('sitemap filter excludes every candidate URL; refusing to emit empty sitemap');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Unit-test the filter callback against a few representative URLs before shipping it.","Include customPages with the homepage as a baseline entry.","Confirm sitemap-index.xml exists in dist/ in CI artifacts for every production build."],"tags":["sitemap","filter","no-pages","seo","build"],"backgroundTag":"empty-sitemap","analyzedSha":"157c500c38faa7ecf1251adbaeefcd109470d75c","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}