rss-parser icon indicating copy to clipboard operation
rss-parser copied to clipboard

Broken on webpack 5

Open IRelaxxx opened this issue 2 years ago • 4 comments

Because webpack 5 does not bundle node polyfills by default this package is broken for build systems with webpack 5.

I tried polyfilling by using tsconfig compilerOptions but you cannot polyfill modules required by dependencies of this module.

Workaround: use a bundle from /dist

IRelaxxx avatar May 22 '23 12:05 IRelaxxx

How should I use the workaround? I added node_modules/rss-parser/dist/rss-parser.min.js to the scripts section in angular.json, but it still complains.

Edit: Found it! It's not nessecery to add it to angular.json. Changing import * as Parser from 'rss-parser' to import Parser from '../../../node_modules/rss-parser/dist/rss-parser.min'; worked.

tofra avatar Dec 18 '23 08:12 tofra

Hmmm. I encounter the same problem - but if I try to import in my angular project using import Parser from '../../../../node_modules/rss-parser/dist/rss-parser.min'; then I get an "Could not find a declaration file for module" Error. Any hints ? What could be different on my setup?

jduerr avatar Jan 05 '24 08:01 jduerr

Hmmm. I encounter the same problem - but if I try to import in my angular project using import Parser from '../../../../node_modules/rss-parser/dist/rss-parser.min'; then I get an "Could not find a declaration file for module" Error. Any hints ? What could be different on my setup?

Simply add // @ts-ignore above the import line.

Using import Parser from 'rss-parser/dist/rss-parser'; in an Angular project worked for me.

legendarydrew avatar Jul 29 '24 17:07 legendarydrew