TypeError: Cannot read property 'type' of undefined when using findAll

is anybody know when this error comes?

in my case when is use findall,

this.store.findAll('user/auth').then((response) => {
    console.log(response);
}).catch((err) => {
    console.log(err);
});

Output

TypeError: Cannot read property 'type' of undefined
    at Store._pushInternalModel (-private.js:9132)
    at -private.js:9113
    at Backburner._run (backburner.js:1013)
    at Backburner._join (backburner.js:989)
    at Backburner.join (backburner.js:760)
    at Store._push (-private.js:9098)
    at -private.js:6606
    at invokeCallback (rsvp.js:493)
     at publish (rsvp.js:476)
     at rsvp.js:19

Can you share what the server response actually looks like? This seems like you’re handing something to ember-data that isn’t a valid response.

ya , it’s my mistake , because findAll need array but i have object , that’s why i got error , but you have any idea how to get object, like this

{
  count: 3,
  message: 'Successfully get',
  data: [
    {},{},{}
  ]
}

That depends on what server you’re using. You can change your server to match https://jsonapi.org/, or you can write a custom serializer to make ember-data understand whatever format your server is using.