isomorphic-fetch icon indicating copy to clipboard operation
isomorphic-fetch copied to clipboard

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

Open amitzur opened this issue 6 years ago • 11 comments

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)

amitzur avatar Dec 19 '18 11:12 amitzur

@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.

kevzettler avatar Dec 20 '18 16:12 kevzettler

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

amitzur avatar Jan 02 '19 04:01 amitzur

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

mbifulco avatar Jan 11 '19 14:01 mbifulco

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

kopax avatar Feb 07 '19 20:02 kopax

+1, would need response.arrayBuffer().

tlaukkan avatar Feb 08 '19 09:02 tlaukkan

+1 for the response.arrayBuffer()

joosep-wm avatar May 09 '19 10:05 joosep-wm

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?

matthew-andrews avatar Sep 14 '20 07:09 matthew-andrews

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

amitzur avatar Sep 26 '20 20:09 amitzur

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

molass3s avatar Sep 27 '20 12:09 molass3s

@matthew-andrews any update on this? 🙂

tomtargosz avatar Apr 12 '21 21:04 tomtargosz