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

Broken on webpack 5 #249

Open
IRelaxxx opened this issue May 22, 2023 · 3 comments
Open

Broken on webpack 5 #249

IRelaxxx opened this issue May 22, 2023 · 3 comments

Comments

@IRelaxxx
Copy link

IRelaxxx commented May 22, 2023

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

@tofra
Copy link

tofra commented Dec 18, 2023

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.

@jduerr
Copy link

jduerr commented Jan 5, 2024

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?

@beliven-davide-lorigliola

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.

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

4 participants