There is no method "null". Code generation for smoke packet seems incomplete
I am using multiple core-ajax-dart elements in a webpage. It looks like custom events firing is broken. When using a declarative on-core-response="{{ajaxNewProjectResponse}}"
element, it seems to want to fire a custom event, but there is a smoke pack in there that gives:
Missing method "null" in competences-service. Code generation for the smoke package seems incomplete.
If I make it necessary, through ajaxNewProject.onCoreResponse.listen(ajaxNewProjectResponse);
, it works as expected (the event fires and my event method is called).
It worked. I suspect it might break when I update versions of polymers or core_elements, or when I started using more and more core-ajax-dart elements.
What I understand from the smoke packet is that it can be associated with a polymer transformer. The error leads me to believe that some of the code was not properly generated, and therefore may indicate a structure error rather than an error in my code. I could find a relatively small message about this error message, only https://groups.google.com/a/dartlang.org/forum/#!topic/web/INNHAZhLy1A , but I am not hiding expressions in lines in code. Am I on the right track here?
Mistake:
Exception: Uncaught Error: Missing method "null" in competences-service. Code generation for the smoke package seems incomplete.
Stack Trace:
#0 GeneratedObjectAccessorService.invoke (package:smoke/static.dart:127:7)
#1 invoke (package:smoke/smoke.dart:43:41)
#2 HtmlElement&Polymer.dispatchMethod (package:polymer/src/instance.dart:1138:19)
#3 BindingDelegate&PolymerEventBindings.getEventHandler.<anonymous closure> (package:polymer/src/events.dart:82:32)
#4 _RootZone.runUnaryGuarded (dart:async/zone.dart:1089)
#5 _RootZone.bindUnaryCallback.<anonymous closure> (dart:async/zone.dart:1118)
#6 BindingDelegate&PolymerEventBindings.prepareEventBinding.<anonymous closure>.<anonymous closure> (package:polymer/src/events.dart:101:67)
#7 BlinkEventTarget.dispatchEvent_Callback_Event (dart:_blink:42)
#8 EventTarget.dispatchEvent (dart:html:13924)
#9 HtmlElement&Polymer.fire (package:polymer/src/instance.dart:1201:23)
#10 CoreAjax.processResponse (package:core_elements/core_ajax_dart.dart:208:14)
#11 receive (package:core_elements/core_ajax_dart.dart:190:27)
#12 CoreXhr._makeReadyStateHandler.<anonymous closure> (package:core_elements/core_xhr_dart.dart:107:39)
My Code: Full Code https://github.com/pjjjv/Akepot/tree/0b093b2b9671f4ce0351750d9ce3609dfb4e82f5 . The core-ajax-dart elements are in lib / competences_service.html and to display the error I left an object with the id ajaxNewProject with a declarative event handler.
Excerpt: Html:
<core-ajax-dart id="ajaxNewProject"
url="https://1-dot-akepot-competence-matrix.appspot.com/_ah/api/akepot/v1/project/"
on-core-response="{{ajaxNewProjectResponse}}" on-core-error="{{ajaxError}}"
handleAs="json" method="POST">
</core-ajax-dart>
Dart:
void newProject(Project project){
if(!signedin){
throw new Exception("Not signed in.");
}
ajaxNewProject.url = "https://1-dot-akepot-competence-matrix.appspot.com/_ah/api/akepot/v1/project/$hash";
ajaxNewProject.body = JSON.encode(project.toJson());
ajaxNewProject.go();
}
@reflectable
void ajaxNewProjectResponse(CustomEvent event, Map detail, CoreAjax node) {
...
}
If you run the application, log in to the top left, click New Project and click New Project again. Then check your console.
source to share