matthew-andrews / isomorphic-fetch

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

Promise doesn't return on Node.js v4.4.5 #137

Closed lastmjs closed 7 years ago

lastmjs commented 7 years ago

I'm not sure why this is happening, but with Node.js v4.4.5 the fetch promise never resolves:

const fetch = require('isomorphic-fetch');

console.log('fetch with arrow function');
fetch('google.com').then((response) => {
    console.log('response with arrow function', response);
});

console.log('fetch withot arrow function');
fetch('google.com').then(function(response) {
    console.log('response without arrow function', response);
});

The logs that are supposed to log the responses never log the responses. This works in Node.js v8.0.0