samedi 30 septembre 2017

Ember error about ActiveModelAdapter.extend

I am learning ember and rails from this tutorial http://ift.tt/1MJXarA

I understand this is a pretty old tutorial and some code does not apply anymore. I am able to fix most of the error during learning process. However, there is one error I have no idea how to fix.

I have this piece of code:

import DS from 'ember-data';

export default DS.ActiveModelAdapter.extend({
  namespace: 'api'
});

And I got this error:

Cannot read property 'extend' of undefined@ 187 ms
Expected:   
true
Result:     
false
Source:     
TypeError: Cannot read property 'extend' of undefined
    at Module.callback (http://localhost:4200/assets/popular-media-app.js:11:59)
    at Module.exports (http://localhost:4200/assets/vendor.js:111:32)
    at requireModule (http://localhost:4200/assets/vendor.js:32:18)
    at Class._extractDefaultExport (http://localhost:4200/assets/vendor.js:70638:20)
    at Class.resolveOther (http://localhost:4200/assets/vendor.js:70359:32)
    at Class.superWrapper [as resolveOther] (http://localhost:4200/assets/vendor.js:56118:22)
    at Class.resolve (http://localhost:4200/assets/vendor.js:23536:35)
    at resolve (http://localhost:4200/assets/vendor.js:21501:36)
    at Registry.resolve (http://localhost:4200/assets/vendor.js:21189:21)
    at Registry.resolve (http://localhost:4200/assets/vendor.js:21193:55)

After tons of testing, I am sure the problem is cause by ActiveModelAdapter. I went through the documents for this class. It seems fine. I really have no idea why this is an error. Could someone help me with this?

I understand you may not be able to figure out what's wrong with the code I provide, but I really don't know what other code do you need. If you need additional code, please let me know.




Aucun commentaire:

Enregistrer un commentaire