javascript - ember-cli "TypeError: desc.get is not a function" after upgrade of ember-cli -
after updating ember-cli v0.2.7 ember v.1.12.0 i'm having funny behavior causes exception when using computed properties.
used model:
user = ember.object.extend md5: "" gravatar: (-> return get_gravatar(@get("md5")) ).property("md5")
calling u.get("gravatar")
in router, aftermodel
method, this:
u.get("gravatar") ember.debug.js:15588 uncaught typeerror: desc.get not function @ object.get (../vendor.js:26142:19) @ exports.default.mixin.mixin.create.get (../vendor.js:39811:27) @ eval (eval @ evaluate (unknown source), <anonymous>:1:3) @ object.injectedscript._evaluateon (<anonymous>:895:55) @ object.injectedscript._evaluateandwrap (<anonymous>:828:34) @ object.injectedscript.evaluateoncallframe (<anonymous>:954:21) @ aftermodel (../v4.js:3438:16) @ applyhook (../vendor.js:55667:32) @ object.handlerinfo.runsharedmodelhook (../vendor.js:53668:22) @ object.handlerinfo.runaftermodelhook (../vendor.js:53651:21)
when digging bit deeper saw error happens in `ember.debug.js @ getter function.
function get(obj, keyname) { ... if (desc) { return desc.get(obj, keyname); // -> error while processing route: recipe_edit desc.get not function typeerror: desc.get not function } else { ...
the type of desc
was same when called u.gravatar
directly, i'm not quite sure why doesn't resolved anymore.
desc: object _cacheable: true _dependentkeys: array[1] _readonly: false isdescriptor: true __proto__: object
after hours of debugging figured out problem myself. have serializer resolves circular references , removes unnecessary attributes ember object convert json.
in previous ember version worked fine, in version somehow recursive function worked way through object ember framework code , deleted functions ember framework during runtime.
computedpropertyprototype.volatile() computedpropertyprototype.property() exports.default.mixin.mixin.create.clear() exports.default.mixin.mixin.create.popobject() exports.default.mixin.mixin.create.shiftobject() ...
therefore got these weird sounding errors , difficult debug errors, deletion of property happens before causes error.
it bad hacky serializer, hope helps of when stumbling upon same error.
Comments
Post a Comment