I'm trying to use rss-parser
in my react app.
After installing the library, I implemented the following:
import Parser from 'rss-parser';
let parser = new Parser();
(async () => {
let feed = await parser.parseURL('https://www.reddit.com/.rss');
console.log(feed.title);
feed.items.forEach(item => {
console.log(item.title + ':' + item.link)
});
})();
This throws the following error:
ERROR in ./node_modules/rss-parser/lib/parser.js 3:13-28
Module not found: Error: Can't resolve 'http' in '\node_modules\rss-parser\lib'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }
Where should I set the resolve.fallback info ?