nascentdigital / contentfully

A simple but performant REST client for Contentful.
MIT License
18 stars 7 forks source link

Hard dependency on node-fetch breaks React Native #44

Open abouthalf opened 3 years ago

abouthalf commented 3 years ago

ContentfulClient is written to have a hard-coded fallback to node-fetch: https://github.com/nascentdigital/contentfully/blob/cfa6759e122f126b714f41ee69b840fda46bee57/src/contentful/ContentfulClient.ts#L113

This breaks react-native builds, failing a brwoserlist requirement. Browserlist is not packaged (for obvious reasons) with Expo or the Metro bundler.

sdedios commented 3 years ago

We'll look into this for the current feature release on rate limits (i.e. 1.10.0) and try to remove the dependency if it doesn't break the existing v1 branch.

I'll post an update once I reproduce the issue. Thanks!

abouthalf commented 3 years ago

Thanks! Really enjoy this library btw - makes Contentful API very easy to use.

TooTallNate commented 1 year ago

The node-fetch dependency also cause issues with Vercel Edge Functions. 👍 to remove this dep.