{"record":{"id":"4f63c43ce3541fa2","repo":"facebook/docusaurus","slug":"generating-feedtype-feed-failed","errorCode":null,"errorMessage":"Generating ${feedType} feed failed.","messagePattern":"Generating (.+?) feed failed\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/docusaurus-plugin-content-blog/src/feed.ts","lineNumber":325,"sourceCode":"  generatePath: string;\n  feedOptions: FeedOptions;\n  contentPaths: BlogContentPaths;\n}) {\n  try {\n    const feedConfig = FeedConfigs[feedType];\n\n    let feedContent = feedConfig.getContent(feed);\n\n    const xsltFilePath = feedConfig.getXsltFilePath(feedOptions.xslt);\n    if (xsltFilePath) {\n      await generateXsltFiles({xsltFilePath, contentPaths, generatePath});\n      feedContent = injectXslt({feedContent, xsltFilePath});\n    }\n\n    const outputPath = path.join(generatePath, feedConfig.outputFileName);\n    await fs.outputFile(outputPath, feedContent);\n  } catch (err) {\n    throw new Error(`Generating ${feedType} feed failed.`, {\n      cause: err,\n    });\n  }\n}\n\nfunction shouldBeInFeed(blogPost: BlogPost): boolean {\n  const excluded =\n    blogPost.metadata.frontMatter.draft ||\n    blogPost.metadata.frontMatter.unlisted;\n  return !excluded;\n}\n\nexport async function createBlogFeedFiles({\n  blogPosts: allBlogPosts,\n  options,\n  siteConfig,\n  outDir,\n  locale,","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-plugin-content-blog/src/feed.ts#L307-L343","documentation":"Wrapper thrown by generateFeed when anything during feed generation fails — fetching feed config, computing content, applying XSLT, or writing the output file. The original error is preserved via {cause: err} and feedType (rss/atom/json) is included so you know which feed broke.","triggerScenarios":"Any unhandled rejection inside the per-feedType generation try block: invalid feed options, XSLT injection failure, fs write permission errors, or downstream errors from feedConfig.getContent.","commonSituations":"Misconfigured feed options, a previously-undetected XSLT problem now reaching the generation step, disk full / permissions on the generatePath, or a malformed blog post metadata breaking getContent.","solutions":["Inspect err.cause to find the real failure.","Confirm the feed type and outputPath reported in the surrounding logs.","Fix the underlying issue (XSLT, options, permissions) and rebuild."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await generateFeed({...});\n} catch (err) {\n  const cause = (err as Error & {cause?: Error}).cause;\n  console.error(`Feed failed (${feedType}):`, cause ?? err);\n}","preventionTips":["Test feed config on a small subset of posts before deploying.","Always drill into err.cause for the real failure."],"tags":["blog","feed","wrapper","cause"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}