{"action":"closed","issue":{"url":"https://api.github.com/repos/joshuef/safe-js/issues/13","repository_url":"https://api.github.com/repos/joshuef/safe-js","labels_url":"https://api.github.com/repos/joshuef/safe-js/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/joshuef/safe-js/issues/13/comments","events_url":"https://api.github.com/repos/joshuef/safe-js/issues/13/events","html_url":"https://github.com/joshuef/safe-js/issues/13","id":184155528,"number":13,"title":"polyfill can't read data: `TypeError: response.buffer is not a function`","user":{"login":"gnunicorn","id":40496,"avatar_url":"https://avatars.githubusercontent.com/u/40496?v=3","gravatar_id":"","url":"https://api.github.com/users/gnunicorn","html_url":"https://github.com/gnunicorn","followers_url":"https://api.github.com/users/gnunicorn/followers","following_url":"https://api.github.com/users/gnunicorn/following{/other_user}","gists_url":"https://api.github.com/users/gnunicorn/gists{/gist_id}","starred_url":"https://api.github.com/users/gnunicorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnunicorn/subscriptions","organizations_url":"https://api.github.com/users/gnunicorn/orgs","repos_url":"https://api.github.com/users/gnunicorn/repos","events_url":"https://api.github.com/users/gnunicorn/events{/privacy}","received_events_url":"https://api.github.com/users/gnunicorn/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-20T07:36:49Z","updated_at":"2016-11-12T17:06:22Z","closed_at":"2016-11-12T17:06:22Z","body":"Trying to read structured data with the polyfill for local development, I run into a problem that the safe-js internals are failing to read the response properly with `TypeError: response.buffer is not a function(…)`\n\nInvestigating this further, it turns out safe-js is using the `response.buffer`-feature, which is [node only](https://www.npmjs.com/package/node-fetch) and not part of the whatwg standard ([mdn](https://developer.mozilla.org/en-US/docs/Web/API/Response), [living spec](https://fetch.spec.whatwg.org/#response-class)). Though the lib claims to use isomorphic-fetch (which it depends on npm-wise), it is actually relying on node-fetch. Thus it works within the browser, but not with the polyfill.\n\nNot sure if we can just use `response.blob()` for these cases or want to switch to a `response.buffer ? response.buffer() : response.blob()`.\n"}}
{"actor":{"display_login":"joshuef"}}