Hi there!
I came across this library when I was searching for a way to build the RSS feed of my blog as part of the postbuild step, not in the getStaticProps function like I saw all tutorials out there suggesting. next-rss is great 馃帀 because, like next-sitemap, is parsing the build manifest to obtain the list of blogs. That way, I don't need to query the API again to obtain the list.
However, I found an issue immediately. I suspect that when there are dynamic pages, like my case with /pages/blog/[blogPostSlug], it errors out because pageProps is undefined when looping through it as found in .next/server/pages/.... I'm not 100% positive that's the root cause, but it appears that the issue is fixed simply skipping the cases in which pageProps is undefined. See:

Adding these lines in src/feed.ts fixes the issue:

Additionally, I found myself wanting to add more properties in the feed items. Currently, next-rss only sets title, id, link and date, but library feed supports more parameters, like image, category, description and content, so it made sense to allow users to customize them.
Since I saw this project looked stale, I went ahead and made a fork to add the fix, a new feature of allowing to pass more item properties, and security fixes on the dependencies, so I could use it for my project. Here's the published version: https://www.npmjs.com/package/@guillermodlpa/next-rss
You can view here how the next-rss.js configuration ends up looking like with the new createFeedItem config parameter:

Source: https://github.com/guillermodlpa/site/blob/98669ef9fc4e9cbb35a528d3d1540ba1052e4dea/next-rss.js
The nice thing is that we can make next-rss adapt to the page props structure, as opposed to forcing next pages to use the structure defined internally in the package, as it is now.
If your next-rss project is active and maintained, let me know. I'd love to contribute pull requests with those changes and other useful functionality. I believe this library has a lot of potential.
Cheers
Hi there!
I came across this library when I was searching for a way to build the RSS feed of my blog as part of the
postbuildstep, not in thegetStaticPropsfunction like I saw all tutorials out there suggesting.next-rssis great 馃帀 because, like next-sitemap, is parsing the build manifest to obtain the list of blogs. That way, I don't need to query the API again to obtain the list.However, I found an issue immediately. I suspect that when there are dynamic pages, like my case with
/pages/blog/[blogPostSlug], it errors out becausepagePropsisundefinedwhen looping through it as found in.next/server/pages/.... I'm not 100% positive that's the root cause, but it appears that the issue is fixed simply skipping the cases in whichpagePropsis undefined. See:Adding these lines in src/feed.ts fixes the issue:
Additionally, I found myself wanting to add more properties in the feed items. Currently,
next-rssonly setstitle,id,linkanddate, but library feed supports more parameters, likeimage,category,descriptionandcontent, so it made sense to allow users to customize them.Since I saw this project looked stale, I went ahead and made a fork to add the fix, a new feature of allowing to pass more item properties, and security fixes on the dependencies, so I could use it for my project. Here's the published version: https://www.npmjs.com/package/@guillermodlpa/next-rss
You can view here how the
next-rss.jsconfiguration ends up looking like with the newcreateFeedItemconfig parameter:Source: https://github.com/guillermodlpa/site/blob/98669ef9fc4e9cbb35a528d3d1540ba1052e4dea/next-rss.js
The nice thing is that we can make
next-rssadapt to the page props structure, as opposed to forcing next pages to use the structure defined internally in the package, as it is now.If your
next-rssproject is active and maintained, let me know. I'd love to contribute pull requests with those changes and other useful functionality. I believe this library has a lot of potential.Cheers