【问题标题】:Uncaught TypeError: Cannot read property 'apply' of undefined - dart polymer未捕获的类型错误:无法读取未定义的属性“应用” - 飞镖聚合物
【发布时间】:2014-08-07 19:53:38
【问题描述】:

我是飞镖和聚合物的初学者。当我在 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

【问题讨论】:

    标签: dart dart-polymer


    【解决方案1】:

    这个问题是reported。评论 #7 下的技巧让我一次性成功地构建了 javascript 版本。将在 Dart 1.6 中解决。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-12-22
      • 2015-01-06
      • 2017-07-26
      • 2018-11-09
      • 2019-02-26
      相关资源
      最近更新 更多