簡體   English   中英

在Dart中編譯時出錯

[英]Error compiling in Dart

我在本地有AngluarDart的飛鏢。

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] 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 ...

可能是什么問題?

我解決了降級Dart SDK版本的問題。 從1.23.0到1.21.1

現在,編輯器可以毫無問題地完成工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM