Skip to content

Commit

Permalink
fix(client-core): Uncaught TypeError: cubejs is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Dec 31, 2019
1 parent fcbbe84 commit b5c32cd
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 14 deletions.
20 changes: 13 additions & 7 deletions packages/cubejs-client-core/dist/cubejs-client-core.umd.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.cubejs = {}));
}(this, function (exports) { 'use strict';
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.cubejs = factory());
}(this, function () { 'use strict';

function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
Expand Down Expand Up @@ -15743,9 +15743,15 @@
return new CubejsApi(apiToken, options);
});

exports.default = index;
exports.HttpTransport = HttpTransport;
var src = /*#__PURE__*/Object.freeze({
default: index,
HttpTransport: HttpTransport
});

var index$1 = ( src && index ) || src;

var index_umd = index$1;

Object.defineProperty(exports, '__esModule', { value: true });
return index_umd;

}));
3 changes: 3 additions & 0 deletions packages/cubejs-client-core/src/index.umd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const index = require('./index.js');

module.exports = index;
21 changes: 18 additions & 3 deletions packages/cubejs-schema-compiler/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,11 @@ big-number@1.0.0:
resolved "https://registry.yarnpkg.com/big-number/-/big-number-1.0.0.tgz#a0277607a0adb06492d3099546ef0d547785df18"
integrity sha512-cHUzdT+mMXd1ozht8n5ZwBlNiPO/4zCqqkyp3lF1TMPsRJLXUbQ7cKnfXRkrW475H5SOtSOP0HFeihNbpa53MQ==

bignumber.js@7.2.1:
version "7.2.1"
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f"
integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==

bl@^1.0.0:
version "1.2.2"
resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c"
Expand Down Expand Up @@ -2081,6 +2086,16 @@ mute-stream@0.0.7:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=

mysql@^2.17.1:
version "2.17.1"
resolved "https://registry.yarnpkg.com/mysql/-/mysql-2.17.1.tgz#62bba4a039a9b2f73638cd1652ce50fc6f682899"
integrity sha512-7vMqHQ673SAk5C8fOzTG2LpPcf3bNt0oL3sFpxPEEFp1mdlDcrLK0On7z8ZYKaaHrHwNcQ/MTUz7/oobZ2OyyA==
dependencies:
bignumber.js "7.2.1"
readable-stream "2.3.6"
safe-buffer "5.1.2"
sqlstring "2.3.1"

native-duplexpair@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/native-duplexpair/-/native-duplexpair-1.0.0.tgz#7899078e64bf3c8a3d732601b3d40ff05db58fa0"
Expand Down Expand Up @@ -2436,7 +2451,7 @@ read-pkg@^2.0.0:
normalize-package-data "^2.3.2"
path-type "^2.0.0"

readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5:
readable-stream@2.3.6, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5:
version "2.3.6"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
Expand Down Expand Up @@ -2600,7 +2615,7 @@ rxjs@^6.4.0:
dependencies:
tslib "^1.9.0"

safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
safe-buffer@5.1.2, safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
Expand Down Expand Up @@ -2763,7 +2778,7 @@ sprintf-js@~1.0.2:
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=

sqlstring@^2.3.1:
sqlstring@2.3.1, sqlstring@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/sqlstring/-/sqlstring-2.3.1.tgz#475393ff9e91479aea62dcaf0ca3d14983a7fb40"
integrity sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=
Expand Down
4 changes: 2 additions & 2 deletions packages/cubejs-vue/dist/cubejs-vue.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1315,7 +1315,7 @@
// Set @@toStringTag to native iterators
_setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (typeof IteratorPrototype[ITERATOR$3] != 'function') _hide(IteratorPrototype, ITERATOR$3, returnThis);
if (!_library && typeof IteratorPrototype[ITERATOR$3] != 'function') _hide(IteratorPrototype, ITERATOR$3, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
Expand All @@ -1324,7 +1324,7 @@
$default = function values() { return $native.call(this); };
}
// Define iterator
if (BUGGY || VALUES_BUG || !proto[ITERATOR$3]) {
if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR$3])) {
_hide(proto, ITERATOR$3, $default);
}
// Plug for library
Expand Down
6 changes: 4 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import commonjs from "rollup-plugin-commonjs";
import replace from "rollup-plugin-replace";
import alias from 'rollup-plugin-alias';

const bundle = (name, globalName, baseConfig) => {
const bundle = (name, globalName, baseConfig, umdConfig) => {
baseConfig = {
plugins: [
replace({
Expand All @@ -15,7 +15,7 @@ const bundle = (name, globalName, baseConfig) => {
};

const baseUmdConfig = {
...baseConfig,
...(umdConfig || baseConfig),
plugins: [
resolve({
extensions: [ '.ts', '.js', '.json' ],
Expand Down Expand Up @@ -136,6 +136,8 @@ const bundle = (name, globalName, baseConfig) => {

export default bundle('cubejs-client-core', 'cubejs', {
input: "packages/cubejs-client-core/src/index.js",
}, {
input: "packages/cubejs-client-core/src/index.umd.js",
}).concat(bundle('cubejs-client-ws-transport', 'CubejsWebSocketTransport', {
input: "packages/cubejs-client-ws-transport/src/index.js",
})).concat(bundle('cubejs-react', 'cubejsReact', {
Expand Down

0 comments on commit b5c32cd

Please sign in to comment.