GithubHelp home page GithubHelp logo

isomorphic-fetch's Introduction

isomorphic-fetch Build Status

Fetch for node and Browserify. Built on top of GitHub's WHATWG Fetch polyfill.

Warnings

  • This adds fetch as a global so that its API is consistent between client and server.

For ease-of-maintenance and backward-compatibility reasons, this library will always be a polyfill. As a "safe" alternative, which does not modify the global, consider fetch-ponyfill.

Why Use Isomorphic Fetch

The Fetch API is currently not implemented consistently across browsers. This module will enable you to use fetch in your Node code in a cross-browser compliant fashion. The Fetch API is part of the Web platform API defined by the standards bodies WHATWG and W3C.

Installation

NPM

npm install --save isomorphic-fetch

Bower

bower install --save isomorphic-fetch

Usage

require('isomorphic-fetch');

fetch('//offline-news-api.herokuapp.com/stories')
	.then(function(response) {
		if (response.status >= 400) {
			throw new Error("Bad response from server");
		}
		return response.json();
	})
	.then(function(stories) {
		console.log(stories);
	});

License

All open source code released by FT Labs is licenced under the MIT licence. Based on the fine work by jxck.

Alternatives

isomorphic-fetch's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

isomorphic-fetch's Issues

Docs: don’t rely on global variable

In the docs, I’d recommend the following way of using fetch():

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

I wouldn’t create a global variable in the Node.js code, either.

Interceptors / Default Headers

I'm trying to include an auth header in each request to my API.

I can do this with jQuery.ajax using beforeSend, and AngularJS has something called interceptors which make it really easy.

But I can't figure out how to do this using fetch. Any ideas?

How to use the same cookie with current document

I'm using isomorphic-fetch in my redux app. But it does not use the same cookie as the current document. Any suggestion?
My code here:

fetch('/api/login', {
            method: 'POST',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                username: username,
                password: password
            })
        })

Upload progress?

Any tips or suggestions for getting the progress of an HTTP POST using FormData? I couldn't figure out a clean way to do this.

Failed to get response status when 401 with a CORS request

fetch(url,{
  'Accept': 'application/json',
  'Content-Type': 'application/json',
  'Authorization': JSON.parse(window.localStorage.token)
})
.then(function(response){
  alert(response.status)
})

When the request is CORS 401, status code is not alerted,I need to do something such as redirect to login page when token is not right...Thanks in advance

Fail to save Set-cookies data to browser

I am using Chrome 48 and found that it is not able to save the set-cookies details into the browser and therefore I am not able to use isomorphic-fetch to do any cookies/ login related api request. I have been calling an api by code like this:
fetch("/accounts/register/", { method: 'post', headers: { "X-CSRFToken": CSRF.getToken(), "Accept": 'application/json', "Content-Type": 'application/json' }, body: JSON.stringify(payload) }).then(response => { if (response.status == 302) { dispatch(receiveRegistration()) return Promise.reject() } else { return response } }).then(response => response.json().then(json => ({json, response})) ).then(({ json, response }) => { if (!response.ok) { dispatch(failRegistration(json)) } else { dispatch(receiveRegistration()) } })

Please kindly advise if I have been using isomorphic-fetch wrongly or this is actually caused by the underlying "fetch polyfilly" library.

Thanks a lot.

Is it safe to use relative paths?

Hello,

I want to know if it is safe to use relative paths when fetching.

For example:

Use this:  fetch('/api/v1/users')

Instead of: fetch('//domain.com/api/v1/users')

IE11 throws exception if PUT responds with error

Hello,

I'm getting a strange error in IE 11. It occurs only if all 3 of these are true:
-method = PUT
-I return an error from my server, such as a 400 Bad Request
-I have included contents in the Body of my request

SCRIPT7002: XMLHttpRequest: Network Error 0x2efe, Could not complete the operation due to error 00002efe
.

Under the network tab of the debugger, the request will show as PENDING forever.

I had thought it may be an issue with my server's response but I've forced my server to respond with the exact same error for a POST request and everything works as normal.

Code is below. Let me emphasize that if I remove the body from the options, it works as normal.

    fetch ('/api/resource/1/', {
            method: 'put',
            credentials: 'same-origin',
            headers: {
                'Accept': 'application/json',
                'Content-Type': 'application/json; charset=utf-8',
                'X-CSRFToken': Cookies.get('csrftoken')
            },
            body: '{"a":"b"}'
    })

Any idea what's going on? I suspect there's something going on with the charset since adding utf-8 seems to be a common solution to that error message in general and it doesn't occur without a body. The fact I can't duplicate with a POST though makes me think the error may be in fetch rather than on my end.

Thanks for the help!

Suggest more clear file naming

Minor suggestion for a couple of renames...

  • client.js => fetch-bower.js
  • npm-client.js => fetch-npm-browserify.js
  • server.js => fetch-npm-node.js

With a comment on the top indicating that each one runs in a given environment.. that bower.json will use fetch-bower.js, browserify will use fetch-npm-browserify.js and that node will otherwise use fetch-npm-node.js ... It wasn't quite as obvious to me at first glance.

This way all of the implementations are together, and clearly labelled into their role.

Does the client fetch return the fetch method from the module?

Feature request: be a normal package

Munging the global state may be true to the spec, but it goes above and beyond how most people develop Javascript. Most front-end and back-end development is done with require() these days, and I think more people will be accustomed to using var fetch = require('isomoprhic-fetch') than would be comfortable using a global variable, much less than the number of people who understand what particular incantations you've invoked on behalf of the user to get the global state isomorphically munged like you do.

It's absolutely ok to provide a built in helper that munges the global state, adding fetch, but that should be a helper, not the default and only way to use this very fine package.

Question: how to a POST with form-data correctly

Hi,

So my question is how I would implement the following (with request) using isomorphic-fetch

var options = {
    url: authUrlRoot + 'auth',
    followRedirect: false,
    form: {
      client_id: config.APP_KEY,
      redirect_uri: config.REDIRECT_URL,
      response_type: "code"
    }
  };

  request.post(options, function(error, httpResponse, body){
    // Do something here..
  });

I've tried something like

var FormData = require('form-data');
var form = new FormData();
form.append('client_id', config.APP_KEY);
form.append('redirect_url', config.REDIRECT_URL);
form.append('response_type', 'code');
fetch(authUrlRoot + 'auth', { method: 'POST', body: form })
    .then(function(response) {
        if (response.status >= 400) {
            throw new Error("Bad response from server");
        }
        return response.json();
    })
    .then(function(data) {
        console.log(data);
    });

But that gives me "Bad response from server" - status code is 400 Bad request. I might be totally blind, but I cannot seem to figure out what is missing?

Fetch Header getting dropped in Node

I'm working on an isomorphic React app and we've been happily using this fetch library which has worked well until recently.

My problem: Fetch appears to be dropping/removing my X-NO-CACHE header in NodeJS (it works fine when calling Fetch from the browser). Our other headers (such as: accept) seem to be fine.

Here's how I'm setting the header: fetchOptions.headers['X-NO-CACHE'] = true;. I've added tracing to the node-fetch/index.js file and observed the following:

Node Fetch options: 
{ headers: { accept: 'application/json', 'X-NO-CACHE': true },
  credentials: 'same-origin' }

Node Fetch headers: 
Headers { _headers: { accept: [ 'application/json' ] } }

UPDATE: I just realized that it works after I use: fetchOptions.headers['X-NO-CACHE'] = 'true'; (needed to use 'true' instead of true).

Please fix this for Node since it works fine on the client and should work the same on the server.

Thanks!
Jason

Request Method: OPTIONS

I'm trying to make a POST request but I'm still sending OPTIONS as a 'Request Method'.

Example:

import fetch from 'isomorphic-fetch'

fetch('http://localhost:3000/api/v1/sign_in', {
    method: 'POST',
    headers: {
      'Accept': 'application/json',
      'Content-Type': 'application/json'
    },
    body: {
      login: 'test'
    }
})

In Chrome, I can see:
Remote Address:127.0.0.1:3000
Request URL:http://localhost:3000/api/v1/sign_in
Request Method:OPTIONS
Status Code:404 Not Found

Thanks in advance.

Does this library support IE9 CORS?

We are using React and Redux to develop our frontend application. Redux documentation as well as some other examples proposed usage of isomorphic-fetch so we did that as well. The thing is, technically we are not making universal app and we have to support IE9+. Our API is on a different domain and our requests would be firing off from browsers which means we'll have CORS issue with IE9.

We had this issue before with our Angular app and we fixed it using https://github.com/jpillora/xdomain, but I doubt this is something we could use now.

I know we probably had to use https://github.com/github/fetch instead of isomorphic one, but right now it would take few hours to make a switch and fix our mistake. I was going through that library's issues and as far as I can see they merged IE9 CORS support sometime during April JakeChampion/fetch#79.

I see you started this library before that and I suppose there is no need for this library to support that so my question: Is our only fix going back to fetch or this library still supports IE9 CORS requests?

We are still developing our app locally where we can't reproduce CORS requests (probably there is a way, didn't research it yet) so that is a reason why I ask before I try it myself and see if it works. Thanks in advance.

json body not posted

Hi. I'm trying to make a post request with json in the body included. The request is indeed a post request but the json data isn't posted.

Here is an example:

fetch("http://127.0.0.1:8080/v1.0/users", {
      method: 'POST',
      headers: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        email: 'foo',
        pass: 'bar'
      })
    }).then(response => console.log(response))

Results in the following request headers:

POST /v1.0/users HTTP/1.1
Host: 127.0.0.1:8080
Connection: keep-alive
Content-Length: 28
accept: application/json
Origin: http://127.0.0.1:3000
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
content-type: application/json
DNT: 1
Referer: http://127.0.0.1:3000/registration
Accept-Encoding: gzip, deflate
Accept-Language: nl,en-US;q=0.8,en;q=0.6

There is no data posted. Can anyone point me in the right direction? Thanks!

strange dependency requirement uses a random git branch

Trying to install this from the npm repository runs into this line:

"whatwg-fetch": "git+https://github.com/matthew-andrews/fetch#ie9"

Which

  1. requires features from a relatively newer build of npm than what's in the vanilla ubuntu repository
  2. requires git to be installed on the host
  3. appears to be just some random branch?

1 & 2 are making isomorphic-fetch difficult to get installed into a Docker image I'm currently trying to build.

Can not read content-disposition from resposne header

I am creating download url at frontend side and server send me data in response body and content-type, content-disposition in response header. i am able to read response.headers.get('content-type') but not response.headers.get('content-disposition'), is response.headers.get('content-disposition') does not supported ?

Caching?

Just wondering if this module supports caching responses like it does in the browser?

How do you get json body from a 400 bad request?

The API I'm working with responds with 400 Bad Request, with the specifics of the error in the body as JSON. How do I extract this from response? response.statusText just gives me 'Bad Request'.

{
    "message": "(psycopg2.IntegrityError) duplicate key value violates unique constraint \"accounts_name_key\"\n"
}

headers.forEach undefined - update node-fetch

I discovered today that the response.headers.forEach method was undefined in the used version of node-fetch. I checked that project's issue tracker and apparently it has been fixed in that project.

However, this project is still using an older version. Would be great if we could see an update. :)

Cheers.

with POST 502 (Bad Gateway) error fetch returns 'Unexpected token <' message

In my current dev iteration I deliberately do not have my back end server running, so when I try to fetch I get

POST http://mydomain/api/login 502 (Bad Gateway)

in the console as expected, but the fetch catch method returns the message

Unexpected token <

instead.

Any ideas?

This is bad (obviously) because I'd like to present a more sensible error message to the user...

Here's my code:

import fetch = require('isomorphic-fetch')

...

export const loginUser = creds => {

    let config = {
        method: 'POST',
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
        body: `userid=${creds.userid}&password=${creds.password}`
    }
    return dispatch => {
        dispatch(requestLogin(creds))
        fetch('/api/login', config)
            .then(response =>
                response.json().then(user => ({ user, response }))
            )
            .then(({ user, response }) => {
                if (!response.ok) {
                    // If there was a problem, we want to
                    // dispatch the error condition
                    dispatch(loginError(user.message))
                    return Promise.reject(user)
                } else {
                    // If login was successful, set the token in local storage
                    localStorage.setItem('id_token', user.id_token)
                    // Dispatch the success action
                    dispatch(receiveLogin(user))
                }
            })
            .catch(err => { 
                dispatch(loginError(err.message))
                console.log('Error: ', err.message) 
            })
    }
}

the code is taken from https://auth0.com/blog/2016/01/04/secure-your-react-and-redux-app-with-jwt-authentication/

Getting referenceerror: self is not defined when running mocha tests in command line as soon as I attempt to use isomorphic-fetch

So I wanted to use this, and I have a SPA client only app using webpack, npm, es6. The moment I add this line in:

import fetch from 'isomorphic-fetch';

The moment I have this line, my mocha tests crash with -- referenceerror: self is not defined -- error. Mocha browser runs fine, and I can perform a fetch correctly.

I can't get command line mocha test fixed. How do I fix this? I don't have this issue when I import any other libraries, including React-DOM which is definitely dependent on a DOM.

export fetch?

So that the slightly difficult to identify mistake of

var fetch = require('isomorphic-fetch')

doesn't happen

exported fetch is useless on client side

var fetch = require('isomorphic-fetch')

doesn't work on client side, because whatwg-fetch module exports nothing.

To make it work npm-client.js must look like

require('whatwg-fetch');
module.exports = fetch;

(instead of module.exports = require('whatwg-fetch');)

client.js has the same issue, I guess.

Workaround for React Native

Hi, I'm using isomorphic-fetch in a shared library used by React and React Native. React Native provides its own fetch, so I'm currently using a workaround adapted from github/fetch#125.

if (typeof process !== 'undefined') {
    require('isomorphic-fetch');
}

Just wondering if something like this should be integrated into the isomorphic-fetch library. Thanks.

POST req body issue

I'm struggling with this strange problem, I can't seem to solve. So I'm hoping, the good people at github, might point me in the right direction. I'm using isomorphic fetch to post data to a server on localhost. I'm sending the body as a JSON-string. But on the server, I can't read the body, it's just an empty object.

Here is the client-code:

handleSubmit = (event) => {
    const { dispatch } = this.props;

    fetch('/api/me', {
      method: 'POST',
      header: {
        'Accept': 'application/json',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        name: 'xxx'
      })
    })
    .then(response => response.json())
    .then( json => dispatch( login( json ) ))
    .catch( err => console.log(err) )
  }

The server code:

var jsonParser = bodyParser.json()
app.post( '/api/me', jsonParser, ( req, res ) => {
  console.log('req', req.body); // when testing this simply outputs {}
})

All help is much appreciated.

BR

Martin

any possible way to include timeout on fetch()?

couldn't find the docs for this repository...
my code looks like this:

fetch('/test', { method: 'POST', body: data })
    .then(function(response) {
        if (response.status >= 400) {
            throw new Error("Bad response from server");
        }
        return response.json();
})
    .then(function(response) {
        console.log(response)
    });

would like to fake a server response for the fetch... any ideas?

thanks in advance

does isomorphic-fetch support IE8

I am using isomorphic-fetch in our react and redux project. and we should support ie8. now we found out that whatwg-fetch fails in ie8 for the reason that xhr.onload failed to be called. xhr.onreadystatechange works fine.

can I use es7 async/await?

example:

require('isomorphic-fetch');

(async () => {
  try {
    // request
    let response = await fetch('http://localhost:8088/api/v1/hooy');
    // parsing
    let data = await response.json();
    console.log('data: ', data);
  } catch (error) {
    console.log('error: ', error);
  }
}());

sh session:

❯ es6 test1.js
error:  [TypeError: Cannot read property 'json' of undefined]

where es6 alias is:

function es6() { babel --stage=0 --experimental "$@" | iojs; }

I guess it's related to node-fetch, so I've submitted another issue there

Using babel runtime, but still got `ReferenceError: Can't find variable: Promise`

I notice that Promise polyfill should be required.

But the question is, I am already using the babel runtime transformer to transform my code, and I got Object.assign() working just fine. Only new Promise() in whatwg fetch library throw error Can't find variable: Promise.

I am currently using require('es6-promise').polyfill();, and it works fine.

I am wondering why I still need promise polyfill since I am using babel runtime?

'manual' redirect mode is not supported

At least in node (v.4.1.1) passing { redirect: 'manual' } results in follow behavior. The normal opaqueRedirect behavior is of dubious usefulness on server (I really want to be able to inspect every redirect url in a chain and rewrite them as needed), to be fair.

Browserify'd code on upload to Parse.com: ReferenceError: self is not defined

npm command:

 "watchify": "watchify -t babelify src/main.js -o parse/cloud/main.js"

When I try to deploy browserify'd code I get:

The following files will be uploaded:
/Users/barton/projects/MFV/mapbox/scripts/parse/cloud/main.js
Finished uploading files
ReferenceError: self is not defined
    at main.js:1576:7
    at Object.<anonymous> (main.js:1953:3)
    at s (main.js:1:254)
    at main.js:1:305
    at Object.whatwg-fetch (main.js:1569:1)
    at s (main.js:1:254)
    at main.js:1:305
    at Object../Util (main.js:4282:13)
    at s (main.js:1:254)
    at main.js:1:305

main.js 1576:

//
// Return that as the export for use in Webpack, Browserify etc.
require('whatwg-fetch');
module.exports = self.fetch.bind(self);

},{"whatwg-fetch":10}],10:[function(require,module,exports){
(function() {
  'use strict';

  if (self.fetch) {  //<<<<<<<<<< line 1576
    return
  }

main.js 1953: self invoking 'whatwg-fetch':

main.js 1569: require('whatwg-fetch');

main.js 4282: var fetch = require('isomorphic-fetch');

patch method is not working

I have two apps one is a react front end and the second one is the rails-api app.

I have been happily using isomorphic-fetch till I needed to send PATCH method to the server.

I am getting:

Fetch API cannot load http://localhost:3000/api/v1/tasks. Method patch is not allowed by Access-Control-Allow-Methods in preflight response.

but the OPTIONS response from the server includes a PATCH method in a list of Access-Control-Allow-Methods:

screen shot 2016-01-07 at 22 35 04

This is how the fetch is implemented:

const API_URL = 'http://localhost:3000/'                                            
const API_PATH = 'api/v1/'

fetch(API_URL + API_PATH + 'tasks', {
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  method: 'patch',                                                              
  body: JSON.stringify( { task: task } )                                        
})

POST, GET, DELETE are set up pretty much the same and they are working fine.

Any idea what is going on here?

Response object is undefined if the server returns 204 status code.

I don't know if this is a bug or an expected behavior, but i think it should at least return a response object with body = null.

Sample code:

fetch(uri, options)
  .then( (response) => {
    console.log(response) // undefined
    if(response.ok) {
     // this will never be executed
    }
 })

Please advice: how to POST and accept empty reponse of 204 status?

I have the followng code, which stays as pending requiest until timeout error is thrown:

fetch(`/api/users/logout?access_token=${token}`, {
        //body: null,
        credentials: 'include',
        method: 'post',
        headers: {
          'Accept': 'application/json, application/xml, text/plain, text/html, *.*',
          'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
        },
      })
      .then(response => {
        console.log('Test!'); // It will get here only after a huge timeout, not right after request
        if (response.status === 200) return response.json();
        return response.json();
      })

So issue is that I can't make this request really work - it does not get to then() part unless i wait few minutes.Please, advice!

Error when installing locally

Getting this error after a fresh clone and npm install:

$ npm install                            master
npm WARN deprecated [email protected]: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
[email protected] /Users/olalonde/code/isomorphic-fetch
├─┬ [email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   └── [email protected]
├── [email protected]  extraneous
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └─┬ [email protected]
│ │ │   ├── [email protected]
│ │ │   └── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]  extraneous
├─┬ [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └─┬ [email protected]
│ │   ├── [email protected]
│ │   └── [email protected]
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]  (git://github.com/orangemug/semversionizer-comparison.git#ab8200fcc1d79cc19d4050b5475a75caf8614a09)
│ ├─┬ [email protected]  (git://github.com/orangemug/semversionizer-parser.git#22b87a413f1e204f03550b0773b68124d2f9717d)
│ │ └── [email protected]  (git://github.com/orangemug/semver-spec.git#c8c3cac3ffff0829906b19ae62c54265a48ef4dd)
│ └─┬ [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   ├── [email protected]
│   └── [email protected]
└── [email protected]

npm ERR! Darwin 15.0.0
npm ERR! argv "/Users/olalonde/.nvm/versions/node/v5.5.0/bin/node" "/Users/olalonde/.nvm/versions/node/v5.5.0/bin/npm" "install"
npm ERR! node v5.5.0
npm ERR! npm  v3.3.12
npm ERR! path /Users/olalonde/code/isomorphic-fetch/node_modules/editorconfig/bin\editorconfig
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/olalonde/code/isomorphic-fetch/node_modules/editorconfig/bin\editorconfig'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/olalonde/code/isomorphic-fetch/npm-debug.log

Getting the same error on the v2.2.1 tag.

Critical dependencies error with node-fetch encoding

When I try to build universal react app with redux and isomorphic-fetch, I het this error

WARNING in (server) ./~/isomorphic-fetch/~/node-fetch/~/encoding/lib/encoding.js
Critical dependencies:
9:12-34 the request of a dependency is an expression
 @ ./~/isomorphic-fetch/~/node-fetch/~/encoding/lib/encoding.js 9:12-34

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.