Skip to content

Commit

Permalink
fix: Allow SSR: use isomorphic-fetch instead of whatwg-fetch.
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
paveltiunov committed Apr 16, 2019
1 parent 6802876 commit 902e581
Show file tree
Hide file tree
Showing 10 changed files with 282 additions and 909 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-babel": "^4.0.3",
"rollup-plugin-commonjs": "^9.1.6",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^5.0.2"
},
Expand Down
7 changes: 4 additions & 3 deletions packages/cubejs-client-core/dist/cubejs-client-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var _regeneratorRuntime = _interopDefault(require('@babel/runtime/regenerator'))
require('regenerator-runtime/runtime');
var _asyncToGenerator = _interopDefault(require('@babel/runtime/helpers/asyncToGenerator'));
require('core-js/modules/es6.promise');
var whatwgFetch = require('whatwg-fetch');
require('isomorphic-fetch');

var moment = momentRange.extendMoment(Moment);
var TIME_SERIES = {
Expand Down Expand Up @@ -634,7 +634,8 @@ function () {
_createClass(CubejsApi, [{
key: "request",
value: function request(url, config) {
return whatwgFetch.fetch("".concat(this.apiUrl).concat(url), Object.assign({
// eslint-disable-next-line no-undef
return fetch("".concat(this.apiUrl).concat(url), Object.assign({
headers: {
Authorization: this.apiToken,
'Content-Type': 'application/json'
Expand Down Expand Up @@ -727,7 +728,7 @@ function () {
return _context.stop();
}
}
}, _callee);
}, _callee, this);
}));

return function loadImpl() {
Expand Down

0 comments on commit 902e581

Please sign in to comment.