@astrojs/rss
Typescript error for pagesGlobToRssItems
when using strictest
tsconfig
#6590
Closed
1 task done
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
What version of
astro
are you using?2.1.2
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Windows
What browser are you using?
Chrome
Describe the Bug
@astrojs/rss
version 2.3.0This affects only code editor. CLI build still passes.
By using Typescript with
strictest
tsconfig for RSS generation (rss.xml.ts
instead ofrss.xml.js
), there is a type error just by using code from the official tutorial and docs.Problem is that return type from resolved
pagesGlobToRssItems()
does not satisfyRSSOptions.items
.Apparently it's because of
exactOptionalPropertyTypes: true
tsconfig flag.RSSFeedItem.content
type iscontent?: string;
and corresponding part of return type ofpagesGlobToRssItems
iscontent?: string | undefined
.If I modify
RSSFeedItem.content
type in@astrojs/rss/dist/index.d.ts
tocontent?: string | undefined
, the error goes away.Link to Minimal Reproducible Example
https://stackblitz.com/edit/node-h2jxcq?file=src%2Fpages%2Frss.xml.ts
Participation
The text was updated successfully, but these errors were encountered: