我的 Polymer.dart 网络应用程序,在Dartium中正常工作,在使用pub build --mode=debug
使用dart2js编译并在Chrome中加载时,会出现以下错误(重复7次)。 / p>
Resource interpreted as Script but transferred with MIME type text/plain: "http://confab.dev/index.html_bootstrap.dart". confab.dev/:10
warning: file:///home/dan/projects/confabulous/webatara/web/index.html.0.dart library not found index.html_bootstrap.dart.js:17188
Uncaught Error: NoSuchMethodError: Cannot call "get$functions" on "#<JsLibraryMirror>" (Object #<JsLibraryMirror> has no method 'get$functions') index.html_bootstrap.dart.js:17188
Stack Trace:
TypeError: Object #<JsLibraryMirror> has no method 'get$functions'
at dart._loadLibrary (http://confab.dev/index.html_bootstrap.dart.js:20000:19)
at dart._loadLibraries (http://confab.dev/index.html_bootstrap.dart.js:19917:11)
at dart._initPolymerOptimized (http://confab.dev/index.html_bootstrap.dart.js:19908:7)
at dart.initPolymer (http://confab.dev/index.html_bootstrap.dart.js:19902:7)
at main (http://confab.dev/index.html_bootstrap.dart.js:4112:7)
at _IsolateContext.eval$1 (http://confab.dev/index.html_bootstrap.dart.js:1369:23)
at dart.startRootIsolate (http://confab.dev/index.html_bootstrap.dart.js:1145:21)
at http://confab.dev/index.html_bootstrap.dart.js:26514:7
at init.currentScript (http://confab.dev/index.html_bootstrap.dart.js:26494:5)
at http://confab.dev/index.html_bootstrap.dart.js:26508:3
index.html_bootstrap.dart.js:17188
Uncaught NoSuchMethodError: Cannot call "get$functions" on "#<JsLibraryMirror>" (Object #<JsLibraryMirror> has no method 'get$functions') index.html_bootstrap.dart.js:2369
由于源地图似乎无法正常工作(它们已在Chrome中启用,我有.map文件),我甚至不知道我的代码的哪一部分导致了此问题。
我已尝试将interop.js包括在dart.js之前,as the docs say之后,as this issue之后。
答案 0 :(得分:0)
看起来像是dart2js中的一个错误。请提交一个问题,理想情况下是一个可重现的测试用例。
答案 1 :(得分:0)
pub upgrade
修复了它。事实证明,有些东西取代了我在0.8.10 + 4时使用的聚合物0.9.5。很奇怪。对此的解决方案是将聚合物版本设置为&lt;&gt;&gt; = 0.9.5&#39;而不是我最后会做的任何事情,但是现在我有兴趣看看它是否会再次发生。