matthew-andrews / isomorphic-fetch

Isomorphic WHATWG Fetch API, for Node & Browserify
MIT License
6.95k stars 289 forks source link

Update node-fetch to `^2.3.0` (major change) #180

Open amitzur opened 5 years ago

amitzur commented 5 years ago

This PR is similar to #157 except for also refreshing other dev dependencies' major versions, otherwise the tests didn't pass (Uncaught Error [ERR_STREAM_CANNOT_PIPE]: Cannot pipe, not readable).

As noted well in that PR, the changelog for breaking changes in Node.js can be found here: https://github.com/bitinn/node-fetch/blob/master/CHANGELOG.md#v200

I updated the version in package.json to 3.0.0 (major change).

I also added reading the headers in the tests, just to verify that this functionality in node-fetch works as expected.

I believe we can close #157 and accept this. @matthew-andrews wdyt? seems like there's interest in this (#179)

kevzettler commented 5 years ago

@amitzur this is looking good and definitly a needed upgrade but the build is failing:

/home/travis/build/matthew-andrews/isomorphic-fetch/node_modules/lintspaces-cli/node_modules/lintspaces/node_modules/editorconfig/src/index.js:105
        root: path.resolve(options.root || path.parse(filepath).root),
                                                ^
TypeError: Object #<Object> has no method 'parse'
    at processOptions (/home/travis/build/matthew-andrews/isomorphic-fetch/node_modules/lintspaces-cli/node_modules/lintspaces/node_modules/editorconfig/src/index.js:105:49)
    at opts (/home/travis/build/matthew-andrews/isomorphic-fetch/node_modules/lintspaces-cli/node_modules/lintspaces/node_modules/editorconfig/src/index.js:219:9)
    at Object.parseSync (/home/travis/build/matthew-andrews/isomorphic-fetch/node_modules/lintspaces-cli/node_modules/lintspaces/node_modules/editorconfig/src/index.js:256:14)
    at Validator._loadSettingsEditorconfig (/home/travis/build/matthew-andrews/isomorphic-fetch/node_modules/lintspaces-cli/node_modules/lintspaces/lib/Validator.js:201:26)
    at Validator._loadSettings (/home/travis/build/matthew-andrews/isomorphic-fetch/node_modules/lintspaces-cli/node_modules/lintspaces/lib/Validator.js:137:7)
    at Validator.validate (/home/travis/build/matthew-andrews/isomorphic-fetch/node_modules/lintspaces-cli/node_modules/lintspaces/lib/Validator.js:65:8)
    at Object.<anonymous> (/home/travis/build/matthew-andrews/isomorphic-fetch/node_modules/lintspaces-cli/index.js:128:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
npm ERR! Test failed.  See above for more details.
The command "npm test" exited with 1.
amitzur commented 5 years ago

I fixed the failing build by upgrading the node version to 8 which is LTS at the time of writing

mbifulco commented 5 years ago

@emanuelelongo any chance you could work in https://github.com/matthew-andrews/isomorphic-fetch/pull/177 with this release, too?

kopax commented 5 years ago

Any update on this ? We are having issue of whatwg-fetch being installed in 3.0 , less stable than 2.0

tlaukkan commented 5 years ago

+1, would need response.arrayBuffer().

joosep-wm commented 5 years ago

+1 for the response.arrayBuffer()

matthew-andrews commented 4 years ago

Thank you for this and sorry for the incredible delay to reply … I'd like to incorporate your tests in the codebase … would you like to do that or would you be happy if I did this?

amitzur commented 4 years ago

@matthew-andrews not sure I understand the question or if it was directed at me

molass3s commented 4 years ago

Looks like there's low severity DoS vulnerability for versions < 2.6.1, as noted here.

tomtargosz commented 3 years ago

@matthew-andrews any update on this? 🙂