在Dart中编译时出错

时间:2017-05-26 06:33:33

标签: dart angular-dart

我在当地有一个带有AngluarDart的Dart。

Ubuntu 16.04.2 DartSdk v1.23.0

“pub serve”似乎工作正常

$ pub serve
Loading source assets... 
Loading angular2, dart_to_js_script_rewriter and dart_sass_transformer 
transformers... (3.4s)
Serving xxx web on http://localhost:8080
Build completed successfully

但是当我尝试将网络加载到浏览器中时,我收到此错误:

[web] GET Served 3 cached assets.
[Info from Dart2JS]:
Compiling xxx|web/main.dart...
[Error from Dart2JS]:
web/main.dart:
The compiler crashed when compiling this element.
The compiler is broken.

When compiling the above element, the compiler crashed. 
It is not possible to tell if this is caused by a problem in your program or not.
Regardless, the compiler should not crash. 

The Dart team would greatly appreciate if you would take a moment to 
report this problem at http://dartbug.com/new.

Please include the following information:

* the name and version of your operating system,

* the Dart SDK build number (build number could not be determined), and

* the entire message you see here (including the full stack trace
below as well as the source location above).

Build error:
Transform Dart2JS on xxx|web/main.dart threw error: The getter 'uses' 
was called on null.
Receiver: null
Tried calling: uses
dart:core                                               
Object.noSuchMethod
package:compiler_unsupported/src/dump_info.dart 576     
DumpInfoTask.dumpInfoJson
package:compiler_unsupported/src/dump_info.dart 536     
DumpInfoTask.dumpInfo.<fn>
package:compiler_unsupported/src/common/tasks.dart 63   
CompilerTask.measure
package:compiler_unsupported/src/dump_info.dart 533     
DumpInfoTask.dumpInfo
package:compiler_unsupported/src/compiler.dart 703      
Compiler.compileLoadedLibraries.<fn>
package:compiler_unsupported/src/common/tasks.dart 176  
CompilerTask.measureSubtask
package:compiler_unsupported/src/compiler.dart 582      
Compiler.compileLoadedLibraries
package:compiler_unsupported/src/compiler.dart 471      
Compiler.runInternal
===== asynchronous gap ===========================
package:compiler_unsupported/src/compiler.dart 310      Compiler.run.
<fn>.<fn>
dart:async                                              
Future.Future.sync
package:compiler_unsupported/src/compiler.dart 310      Compiler.run.
<fn>
package:compiler_unsupported/src/common/tasks.dart 176  
CompilerTask.measureSubtask
package:compiler_unsupported/src/compiler.dart 307      Compiler.run
package:compiler_unsupported/src/apiimpl.dart 245       CompilerImpl.run.<fn>.<fn>

Build completed with 2 errors.
[web] GET main.dart.js → Could not find asset xxx|web/main.dart.js.
[web] GET favicon.ico → (cached) xxx|web/favicon.ico

我试图再次获得DartSDK,修改了PATH ......

可能是什么问题?

1 个答案:

答案 0 :(得分:0)

我解决了降级Dart SDK版本的问题。 从1.23.0到1.21.1

现在,兼容者没有任何问题地完成了他的工作。