{"record":{"id":"892ba73561e944e5","repo":"gatsbyjs/gatsby","slug":"you-did-not-pass-in-a-valid-serialize-function-yo","errorCode":null,"errorMessage":"You did not pass in a valid serialize function. Your feed will not be generated.","messagePattern":"You did not pass in a valid serialize function\\. Your feed will not be generated\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-plugin-feed/src/gatsby-node.js","lineNumber":38,"sourceCode":"    ...pluginOptions,\n  }\n\n  const baseQuery = await runQuery(graphql, options.query)\n\n  for (const { ...feed } of options.feeds) {\n    if (feed.query) {\n      feed.query = await runQuery(graphql, feed.query).then(result =>\n        merge({}, baseQuery, result)\n      )\n    }\n\n    const { setup, ...locals } = {\n      ...options,\n      ...feed,\n    }\n\n    if (!feed.serialize || typeof feed.serialize !== `function`) {\n      reporter.warn(\n        `You did not pass in a valid serialize function. Your feed will not be generated.`\n      )\n    } else {\n      const rssFeed = (await feed.serialize(locals)).reduce((merged, item) => {\n        merged.item(item)\n        return merged\n      }, new RSS(setup(locals)))\n\n      const outputPath = path.join(publicPath, feed.output)\n      const outputDir = path.dirname(outputPath)\n      if (!(await fs.pathExists(outputDir))) {\n        await fs.mkdirp(outputDir)\n      }\n      await fs.writeFile(outputPath, rssFeed.xml())\n    }\n  }\n}\n","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby-plugin-feed/src/gatsby-node.js#L20-L56","documentation":"Feed-generation guard in gatsby-plugin-feed's onPostBuild: the current feed entry has no `serialize` option or it is not a function, so the plugin cannot convert query results into RSS items and skips generating that feed entirely. Other feeds in the `feeds` array still process.","triggerScenarios":"Thrown at packages/gatsby-plugin-feed/src/gatsby-node.js:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid serialize function in the feed's options (see gatsby-plugin-feed docs)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}