{"record":{"id":"d4519b9bf76c336b","repo":"withastro/astro","slug":"rss-passing-a-glob-result-directly-has-been-depr","errorCode":null,"errorMessage":"[RSS] Passing a glob result directly has been deprecated. Please migrate to the `pagesGlobToRssItems()` helper: https://docs.astro.build/en/recipes/rss/","messagePattern":"\\[RSS\\] Passing a glob result directly has been deprecated\\. Please migrate to the `pagesGlobToRssItems\\(\\)` helper: https://docs\\.astro\\.build/en/recipes/rss/","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/astro-rss/src/index.ts","lineNumber":76,"sourceCode":"type ValidatedRSSFeedItem = z.infer<typeof rssSchema>;\ntype ValidatedRSSOptions = z.infer<typeof rssOptionsValidator>;\ntype GlobResult = z.infer<typeof globResultValidator>;\n\nconst globResultValidator = z.record(\n\tz.string(),\n\tz.function({ input: [], output: z.promise(z.any()) }),\n);\n\nconst rssOptionsValidator = z.object({\n\ttitle: z.string(),\n\tdescription: z.string(),\n\tsite: z.preprocess((url) => (url instanceof URL ? url.href : url), z.string().url()),\n\titems: z\n\t\t.array(rssSchema)\n\t\t.or(globResultValidator)\n\t\t.transform((items) => {\n\t\t\tif (!Array.isArray(items)) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\tcolors.yellow(\n\t\t\t\t\t\t'[RSS] Passing a glob result directly has been deprecated. Please migrate to the `pagesGlobToRssItems()` helper: https://docs.astro.build/en/recipes/rss/',\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\treturn pagesGlobToRssItems(items);\n\t\t\t}\n\t\t\treturn items;\n\t\t}),\n\txmlns: z.record(z.string(), z.unknown()).optional(),\n\tstylesheet: z.union([z.string(), z.boolean()]).optional(),\n\tcustomData: z.string().optional(),\n\ttrailingSlash: z.boolean().default(true),\n});\n\nexport default async function getRssResponse(rssOptions: RSSOptions): Promise<Response> {\n\tconst rssString = await getRssString(rssOptions);\n\treturn new Response(rssString, {\n\t\theaders: {","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/astro-rss/src/index.ts#L58-L94","documentation":"@astrojs/rss validates the `items` option with Zod. Passing the raw result of `import.meta.glob()` — an object mapping file paths to lazy loaders — instead of an array is deprecated: the schema detects the glob shape, prints this yellow deprecation warning, and internally converts it via pagesGlobToRssItems. It still functions, but the direct-glob path is scheduled for removal.","triggerScenarios":"An RSS endpoint with `items: import.meta.glob('./pages/*.md')` — the glob result object flows into the validator, triggers the warning, and is auto-converted.","commonSituations":"Older tutorials and pre-helper example code; upgrading @astrojs/rss to versions that introduced `pagesGlobToRssItems()`.","solutions":["Wrap the glob: `items: await pagesGlobToRssItems(import.meta.glob('./pages/**/*.md'))`","Or map glob entries yourself to an array of `{ link, title, pubDate }` objects","Ensure items ends up a plain array so the deprecation transform never engages"],"exampleFix":"// before (deprecated)\nimport rss from '@astrojs/rss';\nexport const GET = ({ site }) => rss({\n  title: 'Blog', description: '...', site,\n  items: import.meta.glob('./pages/*.md'),\n});\n\n// after\nimport rss from '@astrojs/rss';\nimport { pagesGlobToRssItems } from '@astrojs/rss';\nexport const GET = async ({ site }) => rss({\n  title: 'Blog', description: '...', site,\n  items: await pagesGlobToRssItems(import.meta.glob('./pages/*.md')),\n});","handlingStrategy":"validation","validationCode":"// Normalize items before passing to rss() so the deprecation never triggers\nimport { pagesGlobToRssItems } from '@astrojs/rss';\nconst raw = import.meta.glob('./pages/*.md');\nconst items = Array.isArray(raw) ? raw : await pagesGlobToRssItems(raw);","typeGuard":"type GlobResult = Record<string, () => Promise<unknown>>;\nconst isGlobResult = (v: unknown): v is GlobResult =>\n  typeof v === 'object' && v !== null && !Array.isArray(v) && Object.values(v).every((f) => typeof f === 'function');","tryCatchPattern":null,"preventionTips":["Always `await pagesGlobToRssItems(import.meta.glob(...))` in new code","Type the items option as an array of { link, title?, pubDate? } to catch glob leaks at compile time","Upgrade @astrojs/rss with the migration guide — the direct-glob path will be removed"],"tags":["rss","deprecation","vite-glob"],"backgroundTag":"deprecated-api-usage","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}