Skip to content
New issue

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

Error with chart: Cannot read property 'reference' of undefined #107

Open
jblok opened this issue May 30, 2018 · 2 comments
Open

Error with chart: Cannot read property 'reference' of undefined #107

jblok opened this issue May 30, 2018 · 2 comments

Comments

@jblok
Copy link

jblok commented May 30, 2018

Expected behaviour

I created a Repartition chart that for one of my models. The "Group By" is set to a field that, in my model is a ref to another model. The UI sends this in the body of the request

{
  aggregate:"Count"
  collection:"Recording"
  filters:[]
  group_by_field:"organisation:name"
  query:null
  time_range:null
  timezone:"+01:00"
  type:"Pie"
}

## Actual behaviour

I get an error response back from the API "Cannot read property 'reference' of undefined" with this stack

If I curl the request the UI makes, but change the body so that the field group_by_field equals organisation rather than organisation:name, it works! So not sure if the UI should change or the API.

Failure Logs

TODO: Please include any relevant log snippets, if necessary.

TypeError: Cannot read property 'reference' of undefined
    at getReference (/node_modules/forest-express-mongoose/services/pie-stat-getter.js:17:18)
    at PieStatGetter.perform (/node_modules/forest-express-mongoose/services/pie-stat-getter.js:35:32)
    at get (/node_modules/forest-express/dist/routes/stats.js:20:79)
    at Layer.handle [as handle_request] (/node_modules/forest-express/node_modules/express/lib/router/layer.js:95:5)
...

TODO: Please provide any relevant information about your setup.

  • Package Version:2.9.0
  • Express Version: 4.15.2
  • Mongoose Version: 5.1.2
  • MongoDB Version: 3.6
@jblok
Copy link
Author

jblok commented Sep 26, 2018

Hi, any update on tis bug?

@ItsMrAkhil
Copy link

ItsMrAkhil commented Apr 15, 2019

I'm also facing the same issue. Maybe it's not related to versions of packages. It's been a year by now from the issue opened. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants