title: Uncaught TypeError: Cannot read property 'apply' of undefined - dart polymer
body: <p>I'm a beginner with dart and polymer. When I run the web app in Chrome I get after a few seconds:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'apply' of undefined js_dart2js.dart:310
  JsObject.callMethod$2 js_dart2js.dart:310
  _hookJsPolymer loader.dart:115
  startPolymer loader.dart:55
  initPolymer loader.dart:33
  main init.dart:21
  _IsolateContext.eval$1 isolate_helper.dart:432
  startRootIsolate isolate_helper.dart:97
  (anonymous function) arrrrivals.html_bootstrap.dart.js:24907
  (anonymous function) arrrrivals.html_bootstrap.dart.js:24908
  init.currentScript arrrrivals.html_bootstrap.dart.js:24886
  (anonymous function) arrrrivals.html_bootstrap.dart.js:24899
  (anonymous function) interop.dart:13
  </code></pre>
  
  <p>There are many similar questions for javascript but only one for dart: <a href="https://stackoverflow.com/questions/21127976/dart2js-uncaught-typeerror-cannot-read-property">dart2js Uncaught TypeError cannot read property</a>. However the answer there is just a request for more info. I have tried both 'pub build --mode=debug' and 'pub serve --mode=debug', as well as adding transformers in the pubspec.yaml, but I keep getting the feeling that my built code is minified. Arrrrivals is my app. How can I solve this?</p>
  
  <p>---edited---</p>
  
  <p>After perfecting my app in Dartium further, this error (for Chrome) changed:</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'element' of undefined prototype.js:205
  f.findTypeExtension prototype.js:205
  f.findTypeExtension prototype.js:206
  f.registerPrototype prototype.js:190
  f.register prototype.js:26
  JsFunction.apply$2$thisArg js_dart2js.dart:337
  _hookJsPolymer_registerDart.call$3 loader.dart:135
  Primitives_applyFunction js_helper.dart:1066
  _callDartFunction core_patch.dart:51
  (anonymous function) js_dart2js.dart:103
  d._register polymer-element.js:64
  e.flush queue.js:128
  e.ready queue.js:135
  e.check queue.js:89
  e.go queue.js:69
  d.registerWhenReady polymer-element.js:53
  d polymer.js:49
  b polymer.js:36
  JsFunction.apply$2$thisArg js_dart2js.dart:337
  JsFunction.apply$1 js_dart2js.dart:339
  Polymer_register instance.dart:170
  main_closure50.call$0 arrrrivals.html_bootstrap.dart:165
  startPolymer iterable.dart:310
  initPolymer loader.dart:33
  main init.dart:21
  _IsolateContext.eval$1 isolate_helper.dart:432
  startRootIsolate isolate_helper.dart:97
  (anonymous function) arrrrivals.html_bootstrap.dart.js:26379
  (anonymous function) arrrrivals.html_bootstrap.dart.js:26380
  init.currentScript arrrrivals.html_bootstrap.dart.js:26358
  (anonymous function) arrrrivals.html_bootstrap.dart.js:26371
  (anonymous function) interop.dart:13
  </code></pre>