cube icon indicating copy to clipboard operation
cube copied to clipboard

Giving me weird error

Open ankit6373 opened this issue 7 years ago • 2 comments

fireshot capture 35 - 0pwy35x5rv - codesandbox - https___codesandbox io_s_0pwy35x5rv

I have created 2 Schemas/Tables Orders and Users. In index.js file I am trying to render User's table attributes. I don't have this 'status' attribute in any of my sql table and schema. Why I am getting this even though,I have no where mentioned 'status' and I am trying to render Users schema.

This is my index.js File

 `const CubejsServer = require('@cubejs-backend/server');
  import cubejs from '@cubejs-client/core';
  import Chart from 'chart.js';
  import chartjsConfig from './toChartjsData';

   const cubejsApi = cubejs('eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpIjozODU5NH0.5wEbQo- 
   VG2DEjR2nBpRpoJeIcE_oJqnrm78yUo9lasw'); 

   const server = new CubejsServer();


  const resultSet = await cubejsApi.load({
      measures: ['Users.paying'],
      timeDimensions: [{
        dimension: 'Users.createdAt',
       dateRange: ['2018-01-01', '2018-07-31'],
       granularity: 'month'
    }]
 })
 const context = document.getElementById("myChart");
 new Chart(context, chartjsConfig(resultSet));


 server.listen().then(({ port }) => {
 console.log(`🚀 Cube.js server is listening on ${port}`);
 });`

ankit6373 avatar Feb 25 '19 08:02 ankit6373

Hi ankit6373! Thanks for posting this!

So everything related to @cubejs-client is considered client code and should be executed by browser. We have an issue for server side rendering as well but it isn't supported yet: #1 .

So you should put this client code from index.js to your code sandbox screenshot of which you attached. Please let us know how it goes.

paveltiunov avatar Feb 25 '19 12:02 paveltiunov

@ankit6373 would love to hear from you about this. Closing for now due to inactivity

paveltiunov avatar Mar 01 '19 15:03 paveltiunov