Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

item.categories are not optional #118

Open
jaredcat opened this issue Apr 11, 2024 · 0 comments
Open

item.categories are not optional #118

jaredcat opened this issue Apr 11, 2024 · 0 comments

Comments

@jaredcat
Copy link

jaredcat commented Apr 11, 2024

My feed items do not have categories, and the docs list this as optional.

When running feed.xml():

TypeError: undefined is not an object (evaluating 'item.categories.forEach')
      at /node_modules/rss/lib/index.js:71:9
      at forEach (:1:21)
      at generateXML (/node_modules/rss/lib/index.js:63:5)
      at /node_modules/rss/lib/index.js:185:17

When I change node_modules/rss/lib/index.js:71 to:

item.categories?.forEach(function(category) {
            ifTruePush(category, item_values, { category: { _cdata: category } });
        });

I am able to generate the xml feed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant