Skip to content

Commit b5c32cd

Browse files
committed
fix(client-core): Uncaught TypeError: cubejs is not a function
1 parent fcbbe84 commit b5c32cd

File tree

5 files changed

+40
-14
lines changed

5 files changed

+40
-14
lines changed

packages/cubejs-client-core/dist/cubejs-client-core.umd.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
(function (global, factory) {
2-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3-
typeof define === 'function' && define.amd ? define(['exports'], factory) :
4-
(global = global || self, factory(global.cubejs = {}));
5-
}(this, function (exports) { 'use strict';
2+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3+
typeof define === 'function' && define.amd ? define(factory) :
4+
(global = global || self, global.cubejs = factory());
5+
}(this, function () { 'use strict';
66

77
function _typeof(obj) {
88
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
@@ -15743,9 +15743,15 @@
1574315743
return new CubejsApi(apiToken, options);
1574415744
});
1574515745

15746-
exports.default = index;
15747-
exports.HttpTransport = HttpTransport;
15746+
var src = /*#__PURE__*/Object.freeze({
15747+
default: index,
15748+
HttpTransport: HttpTransport
15749+
});
15750+
15751+
var index$1 = ( src && index ) || src;
15752+
15753+
var index_umd = index$1;
1574815754

15749-
Object.defineProperty(exports, '__esModule', { value: true });
15755+
return index_umd;
1575015756

1575115757
}));
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const index = require('./index.js');
2+
3+
module.exports = index;

packages/cubejs-schema-compiler/yarn.lock

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,11 @@ big-number@1.0.0:
849849
resolved "https://registry.yarnpkg.com/big-number/-/big-number-1.0.0.tgz#a0277607a0adb06492d3099546ef0d547785df18"
850850
integrity sha512-cHUzdT+mMXd1ozht8n5ZwBlNiPO/4zCqqkyp3lF1TMPsRJLXUbQ7cKnfXRkrW475H5SOtSOP0HFeihNbpa53MQ==
851851

852+
bignumber.js@7.2.1:
853+
version "7.2.1"
854+
resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-7.2.1.tgz#80c048759d826800807c4bfd521e50edbba57a5f"
855+
integrity sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==
856+
852857
bl@^1.0.0:
853858
version "1.2.2"
854859
resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c"
@@ -2081,6 +2086,16 @@ mute-stream@0.0.7:
20812086
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
20822087
integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=
20832088

2089+
mysql@^2.17.1:
2090+
version "2.17.1"
2091+
resolved "https://registry.yarnpkg.com/mysql/-/mysql-2.17.1.tgz#62bba4a039a9b2f73638cd1652ce50fc6f682899"
2092+
integrity sha512-7vMqHQ673SAk5C8fOzTG2LpPcf3bNt0oL3sFpxPEEFp1mdlDcrLK0On7z8ZYKaaHrHwNcQ/MTUz7/oobZ2OyyA==
2093+
dependencies:
2094+
bignumber.js "7.2.1"
2095+
readable-stream "2.3.6"
2096+
safe-buffer "5.1.2"
2097+
sqlstring "2.3.1"
2098+
20842099
native-duplexpair@^1.0.0:
20852100
version "1.0.0"
20862101
resolved "https://registry.yarnpkg.com/native-duplexpair/-/native-duplexpair-1.0.0.tgz#7899078e64bf3c8a3d732601b3d40ff05db58fa0"
@@ -2436,7 +2451,7 @@ read-pkg@^2.0.0:
24362451
normalize-package-data "^2.3.2"
24372452
path-type "^2.0.0"
24382453

2439-
readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5:
2454+
readable-stream@2.3.6, readable-stream@^2.2.2, readable-stream@^2.3.0, readable-stream@^2.3.5:
24402455
version "2.3.6"
24412456
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf"
24422457
integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==
@@ -2600,7 +2615,7 @@ rxjs@^6.4.0:
26002615
dependencies:
26012616
tslib "^1.9.0"
26022617

2603-
safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
2618+
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:
26042619
version "5.1.2"
26052620
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
26062621
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
@@ -2763,7 +2778,7 @@ sprintf-js@~1.0.2:
27632778
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
27642779
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
27652780

2766-
sqlstring@^2.3.1:
2781+
sqlstring@2.3.1, sqlstring@^2.3.1:
27672782
version "2.3.1"
27682783
resolved "https://registry.yarnpkg.com/sqlstring/-/sqlstring-2.3.1.tgz#475393ff9e91479aea62dcaf0ca3d14983a7fb40"
27692784
integrity sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=

packages/cubejs-vue/dist/cubejs-vue.umd.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,7 @@
13151315
// Set @@toStringTag to native iterators
13161316
_setToStringTag(IteratorPrototype, TAG, true);
13171317
// fix for some old engines
1318-
if (typeof IteratorPrototype[ITERATOR$3] != 'function') _hide(IteratorPrototype, ITERATOR$3, returnThis);
1318+
if (!_library && typeof IteratorPrototype[ITERATOR$3] != 'function') _hide(IteratorPrototype, ITERATOR$3, returnThis);
13191319
}
13201320
}
13211321
// fix Array#{values, @@iterator}.name in V8 / FF
@@ -1324,7 +1324,7 @@
13241324
$default = function values() { return $native.call(this); };
13251325
}
13261326
// Define iterator
1327-
if (BUGGY || VALUES_BUG || !proto[ITERATOR$3]) {
1327+
if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR$3])) {
13281328
_hide(proto, ITERATOR$3, $default);
13291329
}
13301330
// Plug for library

rollup.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import commonjs from "rollup-plugin-commonjs";
44
import replace from "rollup-plugin-replace";
55
import alias from 'rollup-plugin-alias';
66

7-
const bundle = (name, globalName, baseConfig) => {
7+
const bundle = (name, globalName, baseConfig, umdConfig) => {
88
baseConfig = {
99
plugins: [
1010
replace({
@@ -15,7 +15,7 @@ const bundle = (name, globalName, baseConfig) => {
1515
};
1616

1717
const baseUmdConfig = {
18-
...baseConfig,
18+
...(umdConfig || baseConfig),
1919
plugins: [
2020
resolve({
2121
extensions: [ '.ts', '.js', '.json' ],
@@ -136,6 +136,8 @@ const bundle = (name, globalName, baseConfig) => {
136136

137137
export default bundle('cubejs-client-core', 'cubejs', {
138138
input: "packages/cubejs-client-core/src/index.js",
139+
}, {
140+
input: "packages/cubejs-client-core/src/index.umd.js",
139141
}).concat(bundle('cubejs-client-ws-transport', 'CubejsWebSocketTransport', {
140142
input: "packages/cubejs-client-ws-transport/src/index.js",
141143
})).concat(bundle('cubejs-react', 'cubejsReact', {

0 commit comments

Comments
 (0)