Error compiling in Dart

Issue

I have a Dart with AngluarDart in local.

Ubuntu 16.04.2
DartSdk v1.23.0

“pub serve” seems work fine

$ 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

But when I try to load the web into my browser I get this error:

[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

I tried to get DartSDK again, revised the PATH…

What can be the problem?

Solution

I solved the problem downgrading Dart SDK version.
From 1.23.0 to 1.21.1

Now the complilator do his job without problems.

Answered By – maiky_forrester

Answer Checked By – Robin (FlutterFixes Admin)

Leave a Reply

Your email address will not be published.