Replace isomorphic-fetch with cross-fetch #118
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This thing drove me crazy lol
Working on updates to the miniapp api, I noticed that requests to gpp stopped working with newer
univapay-node
versions.After lots of digging, found that the cause was the upgrade to
isomorphic-fetch
here.isomorphic-fetch@3
usesnode-fetch@2
, which introduced anesm
module. When bundling with rollup, it would importnode-fetch
as a namespace, butisomorphic-fetch
treated it as a cjs import. Long story short, everything beaks.There is a fix pending in
isomorphic-fetch
matthew-andrews/isomorphic-fetch#195, but doesn't seem like it'll be merged soon. On the other hand,cross-fetch
already has the fix merged in and seems better maintained...