-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Labels
kind/enhancementA net-new feature or improvement to an existing featureA net-new feature or improvement to an existing featurestatus/readyReady to be workedReady to be worked
Description
Env:
- Debian Buster
- latest nvm
- latest yarn
- node v15
- latest ipfs-core
I try to use js-ipfs while testing with NodeJS.
As a dependency of ipfs-core, ipfs-utils is installed (dev dependency)
https://github.com/ipfs/js-ipfs-utils/blob/master/src/http/fetch.js
This code check whether or not XMLHttpRequest is available in node and redirect to fetch.browser when available.
However my environment is node and ipfs-utils crashes as fetch.browser requires the global browser fetch.
I could suggest to enhance the initial statement with the following to redirect to fetch.node
if (typeof XMLHttpRequest === 'function' && typeof fetch === 'function') {
module.exports = require('./fetch.browser')
Thanks
Metadata
Metadata
Assignees
Labels
kind/enhancementA net-new feature or improvement to an existing featureA net-new feature or improvement to an existing featurestatus/readyReady to be workedReady to be worked