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

**URL:** <https://discuss.emberjs.com/t/typeerror-cannot-read-property-type-of-undefined-when-using-findall/18432>\
**Category:** Ember Data\
**Created:** [December 16, 2020, 9:29am UTC](https://discuss.emberjs.com/t/typeerror-cannot-read-property-type-of-undefined-when-using-findall/18432 "2020-12-16T09:29:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulsphd](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@rahulsphd](https://discuss.emberjs.com/u/rahulsphd)\
**Post date:** [December 16, 2020, 9:29am UTC](https://discuss.emberjs.com/t/typeerror-cannot-read-property-type-of-undefined-when-using-findall/18432/1 "2020-12-16T09:29:55Z")

</div>

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
> 
> ```

---

<div class="post-metadata">

**Author:** ![ef4](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ef4/32/13470_2.png) [@ef4](https://discuss.emberjs.com/u/ef4)\
**Post date:** [December 16, 2020, 4:17pm UTC](https://discuss.emberjs.com/t/typeerror-cannot-read-property-type-of-undefined-when-using-findall/18432/2 "2020-12-16T16:17:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rahulsphd](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@rahulsphd](https://discuss.emberjs.com/u/rahulsphd)\
**Post date:** [December 17, 2020, 3:40am UTC](https://discuss.emberjs.com/t/typeerror-cannot-read-property-type-of-undefined-when-using-findall/18432/3 "2020-12-17T03:40:31Z")

</div>

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: [
> {},{},{}
> ]
> }
> 
> ```

---

<div class="post-metadata">

**Author:** ![ef4](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ef4/32/13470_2.png) [@ef4](https://discuss.emberjs.com/u/ef4)\
**Post date:** [December 17, 2020, 4:06pm UTC](https://discuss.emberjs.com/t/typeerror-cannot-read-property-type-of-undefined-when-using-findall/18432/4 "2020-12-17T16:06:34Z")

</div>

That depends on what server you’re using. You can change your server to match [https://jsonapi.org/](https://jsonapi.org/), or you can write a [custom serializer](https://guides.emberjs.com/release/models/customizing-serializers/) to make ember-data understand whatever format your server is using.
