contentfully icon indicating copy to clipboard operation
contentfully copied to clipboard

Hard dependency on node-fetch breaks React Native

Open abouthalf opened this issue 4 years ago • 3 comments

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.

abouthalf avatar Jun 10 '21 16:06 abouthalf

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!

sdedios avatar Jun 22 '21 18:06 sdedios

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

abouthalf avatar Jun 22 '21 19:06 abouthalf

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

TooTallNate avatar Mar 28 '23 21:03 TooTallNate