lacymorrow / album-art

💽 Fetch cover art for an artist or album: "The Beatles" ➔ http://path/to/beatles.jpg
https://www.npmjs.com/package/album-art
MIT License
111 stars 12 forks source link

Album-art is missing the "cross-fetch" dependency #21

Closed Dartegnian closed 9 months ago

Dartegnian commented 9 months ago

image

This error shows up when compiling a project that depends on the album-art NPM package.

lacymorrow commented 9 months ago

Can you explain why this is needed?

Dartegnian commented 9 months ago

Apparently isomorphic-fetch isn't recognized as a proper package/provider for the fetch function. Compiling without it yields me this error:

./node_modules/album-art/index.js - Error: Module not found: Error: Can't resolve 'cross-fetch' in '<PROJECT>/node_modules/album-art'

I'm using Angular and I can't install/run my project without installing cross-fetch into my project itself. The two packages are similar, though. With cross-fetch being more updated and having built-in TypeScript declarations.

I personally suggest isomorphic-fetch to just be replaced with cross-fetch.

Dartegnian commented 9 months ago

I've replaced isomorphic-fetch with cross-fetch in commit 961575d.

lacymorrow commented 9 months ago

Works for me.

Thanks for the PR, cheers.

Dartegnian commented 9 months ago

Thank you! Appreciate it, happy to help!

Dartegnian commented 9 months ago

The PR also fixes a build error I get. The problem was also caused by isomorphic-fetch matthew-andrews/isomorphic-fetch#194. Thanks for accepting.

image image