We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem
We have a typescript project which we import cube-client-core library. We are trying to instantiate it as documented:
import cube, { CubeApi } from '@cubejs-client/core'; const cubeApi = cube(token, { apiUrl: `${process.env.CUBEJS_API_URL}/cubejs-api/v1`, });
The project compiles fine with tsc command. However, during runtime, when this code is called, we get the following error:
tsc
TypeError: cube is not a function
We are struggling with that as we cant figure it out. Logging the cube() function with JSON.stringnify gives us something weird:
cube()
JSON.stringnify
{"DEFAULT_GRANULARITY":"day","GRANULARITIES":[{"title":"w/o grouping"},{"name":"second","title":"Second"},{"name":"minute","title":"Minute"},{"name":"hour","title":"Hour"},{"name":"day","title":"Day"},{"name":"week","title":"Week"},{"name":"month","title":"Month"},{"name":"quarter","title":"Quarter"},{"name":"year","title":"Year"}]}
It seems it is holding the entire module and the default export is not working properly.
This is our tsconfig file:
{ "extends": "@tsconfig/node-lts/tsconfig.json", "compilerOptions": { /* Visit https://aka.ms/tsconfig to read more about this file */ "rootDir": "./src", "outDir": "./dist", "sourceMap": true, "moduleResolution": "nodenext", }, }
We are pretty sure we are missing something on the tsconfig, but cant find out what it is...
Any help would be much appreciated.
Thank you!
The text was updated successfully, but these errors were encountered:
igorlukanin
No branches or pull requests
Problem
We have a typescript project which we import cube-client-core library.
We are trying to instantiate it as documented:
The project compiles fine with
tsc
command.However, during runtime, when this code is called, we get the following error:
TypeError: cube is not a function
We are struggling with that as we cant figure it out.
Logging the
cube()
function withJSON.stringnify
gives us something weird:It seems it is holding the entire module and the default export is not working properly.
This is our tsconfig file:
We are pretty sure we are missing something on the tsconfig, but cant find out what it is...
Any help would be much appreciated.
Thank you!
The text was updated successfully, but these errors were encountered: