ipfs / ipfs/js-ipfs-utils

Problem when importing fetch in new version of native-fetch

Open
#216 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
25
Forks
30
PR merge metrics
No merged PRs in 30d

Description

https://github.com/ipfs/js-ipfs-utils/blob/5eecdcbd81f5448ba1d4c0d2ad2050d0ceb240a0/src/fetch.browser.js#L10

When using the browser compile of this, the system ultimately imports "native-fetch" but the API of native-fetch doesn't have fetch as the default export, but rather as { fetch } on the exports.

The implementation is here https://github.com/achingbrain/native-fetch/blob/master/src/index.js
So either this code should be changed to not use default here

https://github.com/ipfs/js-ipfs-utils/blob/5eecdcbd81f5448ba1d4c0d2ad2050d0ceb240a0/src/http/fetch.browser.js#L5

Or request native-fetch to export fetch as default in addition to { fetch }

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.