# \[SOLVED\] How to resolve: Encountered a resource object with an undefined type

**URL:** <https://discuss.emberjs.com/t/solved-how-to-resolve-encountered-a-resource-object-with-an-undefined-type/9715>\
**Category:** Ember Data\
**Created:** [February 9, 2016, 2:54am UTC](https://discuss.emberjs.com/t/solved-how-to-resolve-encountered-a-resource-object-with-an-undefined-type/9715 "2016-02-09T02:54:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevGuy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/devguy/32/12081_2.png) [@DevGuy](https://discuss.emberjs.com/u/DevGuy)\
**Post date:** [February 9, 2016, 2:54am UTC](https://discuss.emberjs.com/t/solved-how-to-resolve-encountered-a-resource-object-with-an-undefined-type/9715/1 "2016-02-09T02:54:27Z")

</div>

Hello, I am not sure what this error is telling me and most of all how to go about fixing it.

```
Error while processing route: index Assertion Failed: Encountered a resource object with an undefined type (resolved resource using connect@serializer:application:) Error: Assertion Failed: Encountered a resource object with an undefined type (resolved resource using connect@serializer:application:)
    at new Error (native)
    at Error.EmberError (http://localhost:4200/assets/vendor.js:26885:21)
    at assert (http://localhost:4200/assets/vendor.js:16833:13)
    at Object.assert (http://localhost:4200/assets/vendor.js:26655:34)
    at assert (http://localhost:4200/assets/vendor.js:67485:37)
    at _normalizeResourceHelper (http://localhost:4200/assets/vendor.js:79391:41)
    at _normalizeDocumentHelper (http://localhost:4200/assets/vendor.js:79352:25)
    at _normalizeResponse (http://localhost:4200/assets/vendor.js:79436:36)
    at normalizeArrayResponse (http://localhost:4200/assets/vendor.js:80142:19)
    at normalizeFindAllResponse (http://localhost:4200/assets/vendor.js:80012:42)logError @ ember.debug.js:27966defaultActionHandlers.error @ ember.debug.js:27909triggerEvent @ ember.debug.js:28025trigger @ ember.debug.js:52525Transition.trigger @ ember.debug.js:52339(anonymous function) @ ember.debug.js:52159tryCatch @ ember.debug.js:52858invokeCallback @ ember.debug.js:52873publish @ ember.debug.js:52841publishRejection @ ember.debug.js:52776(anonymous function) @ ember.debug.js:31434Queue.invoke @ ember.debug.js:327Queue.flush @ ember.debug.js:391DeferredActionQueues.flush @ ember.debug.js:192Backburner.end @ ember.debug.js:570Backburner.run @ ember.debug.js:692Backburner.join @ ember.debug.js:712run.join @ ember.debug.js:20631hash.success @ rest.js:745fire @ jquery.js:3148self.fireWith @ jquery.js:3260done @ jquery.js:9314callback @ jquery.js:9718
ember.debug.js:52499 

Transition #0: index: transition was aborted

```

I am fetching data from mongodb via node, my returned data looks like this:

```
$ curl http://localhost:3000/api/guests

{"data":[{"_id":"56b7ecbc1ef21172377d6159","name":"Ray","message":"First ever guest post entry"},{"_id":"56b7ecbc1ef21172377d615a","name":"Sam","message":"Sam like the new guest post page"}]}

```

---

<div class="post-metadata">

**Author:** ![emberigniter](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@emberigniter](https://discuss.emberjs.com/u/emberigniter)\
**Post date:** [February 9, 2016, 5:45am UTC](https://discuss.emberjs.com/t/solved-how-to-resolve-encountered-a-resource-object-with-an-undefined-type/9715/2 "2016-02-09T05:45:22Z")

</div>

Hi DevGuy, Ember Data is not understanding your API response format. Your app is probably using `JSONAPISerializer`, which expects something along the lines of

`{ data: [{ "id": "56b7ecbc1ef21172377d6159", "type": "guest", "attributes": { "name":"Ray","message":"First ever guest post entry" } }, ...] }` (note the top-level id -no underscore- and type)

For more information you should check out [the spec](http://jsonapi.org/format/). A few months ago I wrote about customizing adapters and serializers: [Fit Any Backend Into Ember with Custom Adapters & Serializers - Ember Igniter](http://emberigniter.com/fit-any-backend-into-ember-custom-adapters-serializers/)

Alternatively, you can use `RESTSerializer`, check out the Ember docs.

---

<div class="post-metadata">

**Author:** ![DevGuy](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/devguy/32/12081_2.png) [@DevGuy](https://discuss.emberjs.com/u/DevGuy)\
**Post date:** [February 9, 2016, 8:26am UTC](https://discuss.emberjs.com/t/solved-how-to-resolve-encountered-a-resource-object-with-an-undefined-type/9715/3 "2016-02-09T08:26:00Z")

</div>

Hi emberigniter,

thanks for the answer, I realized that’s what I had to do after staring long into the ember mirage example. Looking forward to reading your write up after some rest, hopefully it will help me write out the serializer I need to code since I hard-coded some sample data.

---

<div class="post-metadata">

**Author:** ![Gaurav\_Dasgupta](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/gaurav_dasgupta/32/16416_2.png) [@Gaurav\_Dasgupta](https://discuss.emberjs.com/u/Gaurav_Dasgupta)\
**Post date:** [April 7, 2019, 11:01am UTC](https://discuss.emberjs.com/t/solved-how-to-resolve-encountered-a-resource-object-with-an-undefined-type/9715/5 "2019-04-07T11:01:27Z")

</div>

Hi EmberIgniter, I just wanted to thank you for the awesome article you wrote on Ember JSON serializers, it saved me in real sense, my JSON format was not as per the specs and my attribute keys were in camelCase which were creating issue till the end… but your article was like a torch bearer in my journey in the dark
