未捕获的TypeError:无法读取未定义的属性'apply' - dart聚合物

时间:2014-08-07 19:53:38

标签: dart dart-polymer

我是飞镖和聚合物的初学者。当我在Chrome中运行网络应用时,我会在几秒钟后得到:

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

javascript有很多类似的问题,但dart只有一个:dart2js Uncaught TypeError cannot read property。然而,答案只是要求更多信息。我尝试了'pub build --mode = debug'和'pub serve --mode = debug',以及在pubspec.yaml中添加变换器,但我一直觉得我的构建代码已经缩小了。 Arrrrivals是我的应用程序。我该如何解决这个问题?

--- ---编辑

在Dartium中进一步完善我的应用后,此错误(针对Chrome)发生了变化:

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

1 个答案:

答案 0 :(得分:2)

此问题为reported。评论#7的诀窍让我成功构建了一次性的javascript版本。将在Dart 1.6中解决。