{"record":{"id":"b805da02135f515c","repo":"withastro/astro","slug":"issue-path-join-issue-message","errorCode":null,"errorMessage":" ${issue.path.join('.')}  ${issue.message + '.'}","messagePattern":" \\$\\{issue\\.path\\.join\\('\\.'\\)\\}  \\$\\{issue\\.message \\+ '\\.'\\}","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/integrations/sitemap/src/index.ts","lineNumber":269,"sourceCode":"\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tawait writeSitemap({\n\t\t\t\t\t\tfilenameBase: filenameBase,\n\t\t\t\t\t\thostname: finalSiteUrl.href,\n\t\t\t\t\t\tdestinationDir: destDir,\n\t\t\t\t\t\tpublicBasePath: config.base,\n\t\t\t\t\t\tsourceData: urlData,\n\t\t\t\t\t\tlimit: entryLimit,\n\t\t\t\t\t\tcustomSitemaps,\n\t\t\t\t\t\txslURL: xslURL,\n\t\t\t\t\t\tlastmod,\n\t\t\t\t\t\tnamespaces: opts.namespaces,\n\t\t\t\t\t});\n\t\t\t\t\tlogger.info(`\\`${outFile}\\` created at \\`${path.relative(process.cwd(), destDir)}\\``);\n\t\t\t\t} catch (err) {\n\t\t\t\t\tif (err instanceof ZodError) {\n\t\t\t\t\t\tlogger.warn(formatConfigErrorMessage(err));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow err;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t};\n};\n\nexport default createPlugin;\n","sourceCodeStart":251,"sourceCodeEnd":280,"githubUrl":"https://github.com/withastro/astro/blob/157c500c38faa7ecf1251adbaeefcd109470d75c/packages/integrations/sitemap/src/index.ts#L251-L280","documentation":"At build time the @astrojs/sitemap integration feeds every URL entry (page URLs plus whatever your `serialize`/`chunks` callbacks return) into the `sitemap` package, which validates each item with Zod. When an item fails validation, the ZodError is caught here and each issue is logged as ` path message` lines instead of throwing. The affected sitemap file is skipped and the build continues — so a silent typo means your sitemap quietly never ships.","triggerScenarios":"A `serialize` callback returning `changefreq: 'sometimes'` (must be always/hourly/daily/weekly/monthly/yearly/never), `priority` outside 0–1 or as a string, a malformed `lastmod`, or an invalid `url` on any item.","commonSituations":"Copy-pasted serialize functions from blog posts; chunks callbacks mutating items; upgrading the sitemap package to a version with stricter item validation.","solutions":["Read the logged issue path (e.g., `changefreq`) — it names the exact field and expected shape","Fix the serialize/chunks callback to return valid SitemapItem values","Add a unit test over your serialize output validating changefreq/priority/lastmod before builds","Rebuild and confirm the `sitemap-index.xml created at` info line reappears"],"exampleFix":"// before: invalid changefreq and priority -> sitemap skipped\nserialize: (item) => ({ ...item, changefreq: 'sometimes', priority: 1.5 })\n\n// after: valid values\nserialize: (item) => ({ ...item, changefreq: 'weekly', priority: 0.8 })","handlingStrategy":"validation","validationCode":"// Validate serialize/chunks output before it ever reaches the sitemap writer\nconst CHANGEFREQ = new Set(['always','hourly','daily','weekly','monthly','yearly','never']);\nfunction assertValidItems(items) {\n  for (const it of items) {\n    if (it.changefreq && !CHANGEFREQ.has(it.changefreq)) throw new Error(`bad changefreq: ${it.changefreq}`);\n    if (it.priority != null && !(it.priority >= 0 && it.priority <= 1)) throw new Error(`bad priority: ${it.priority}`);\n    new URL(it.url); // throws on malformed urls\n  }\n}","typeGuard":"const CHANGEFREQ = new Set(['always','hourly','daily','weekly','monthly','yearly','never']);\nconst isSitemapItem = (i: unknown): i is { url: string; changefreq?: string; priority?: number } => {\n  const it = i as any;\n  return typeof it?.url === 'string'\n    && (!it.changefreq || CHANGEFREQ.has(it.changefreq))\n    && (it.priority === undefined || (typeof it.priority === 'number' && it.priority >= 0 && it.priority <= 1));\n};","tryCatchPattern":null,"preventionTips":["Type serialize return values as SitemapItem so the compiler catches bad literals","Unit-test your serialize function against the changefreq/priority enums","After each build, assert dist/sitemap-index.xml exists — validation failures skip the file silently"],"tags":["sitemap","zod","build","validation"],"backgroundTag":"sitemap-item-validation-failed","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"}