在Dart中编译时出错

在Dart中编译时出错,dart,angular-dart,Dart,Angular Dart,我在本地有一个艺术飞镖 Ubuntu 16.04.2 DartSdk v1.23.0 “酒吧服务”似乎很管用 $ 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 succe

我在本地有一个艺术飞镖

Ubuntu 16.04.2 DartSdk v1.23.0

“酒吧服务”似乎很管用

$ 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加载到浏览器时,会出现以下错误:

[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
[web]获取3个缓存资产。
[来自Dart2JS的信息]:
正在编译xxx | web/main.dart。。。
[来自Dart2JS的错误]:
web/main.dart:
编译器在编译此元素时崩溃。
编译器坏了。
编译上述元素时,编译器崩溃。
无法判断这是否是由程序中的问题引起的。
无论如何,编译器不应该崩溃。
如果您能抽出一点时间,Dart团队将不胜感激
请在以下位置报告此问题:http://dartbug.com/new.
请提供以下信息:
*操作系统的名称和版本,
*Dart SDK内部版本号(无法确定内部版本号),以及
*您在此处看到的整个消息(包括完整堆栈跟踪)
下面以及上面的源位置)。
生成错误:
在xxx | web/main.dart上转换Dart2JS抛出错误:getter“使用”
在null上调用了。
收件人:空
尝试呼叫:使用
飞镖:核心
Object.nosuch方法
包:编译器\u unsupported/src/dump\u info.dart 576
DumpInfoTask.dumpInfoJson
包:编译器不支持/src/dump\u info.dart 536
DumpInfoTask.dumpInfo。
包:编译器不支持/src/common/tasks.dart 63
编译器任务.measure
包:编译器不支持/src/dump\u info.dart 533
DumpInfoTask.dumpInfo
包:compiler\u unsupported/src/compiler.dart 703
Compiler.compileLoadedLibraries。
包:编译器不支持/src/common/tasks.dart 176
CompilerTask.measureSubtask
包:compiler\u unsupported/src/compiler.dart 582
Compiler.compileLoadedLibraries
包:compiler\u unsupported/src/compiler.dart 471
编译器.runInternal
======异步间隙===========================
包:compiler\u unsupported/src/compiler.dart 310 compiler.run。
.
dart:异步
Future.Future.sync
包:compiler\u unsupported/src/compiler.dart 310 compiler.run。
包:编译器不支持/src/common/tasks.dart 176
CompilerTask.measureSubtask
包:compiler\u unsupported/src/compiler.dart 307 compiler.run
包:compiler\u unsupported/src/apimpl.dart 245 CompilerImpl.run。。
生成已完成,但有2个错误。
[web]获取main.dart.js→ 找不到资产xxx | web/main.dart.js。
[web]获取favicon.ico→ (缓存)xxx | web/favicon.ico
我试图再次获得DartSDK,修改了路径


有什么问题吗?

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


现在,编辑者可以毫无问题地完成他的工作。

添加您的dart代码部分